Re: Perl book

2003-01-15 Thread Randal L. Schwartz
> "Dylan" == Dylan Boudreau <[EMAIL PROTECTED]> writes:

Dylan> I have already read Learning Perl and am looking to get another book to
Dylan> learn more what would people recommend?

If you liked Learning Perl, and can wait a few months, I might be able
to recommend another book that would fit quite nicely.  :-)

print "Just another Perl [book] hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: waitpid

2003-01-15 Thread Mark Goland
> 1.  Use :
> $ENV{DESTDIR} = "/mnt";
> That will set the environment variable that is passed to any
> subshells (such as system calls).  Executing a system(setenv...) is kind
> of like a noop, since the shell sets it and then exists...so it
> disappears.

This will work for script and all sub kids of the script, but not the
original shell, in which system calls get executed.

>  There really isn't a
> "good" way to deal with this.  Perhaps if the process returned it's PID
> after the fork you could look for it and then keep looking and waiting for
> it (I don't think waitpid would work for you here, since you won't get a
> signal from a process that isn't a child of yours when it exits).
>

Yeh, thats exactly what I am looking for.

- Original Message -
From: "Chander Ganesan" <[EMAIL PROTECTED]>
To: "Mark Goland" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 4:37 PM
Subject: Re: waitpid


> Hello,
>
> 1.  Use :
> $ENV{DESTDIR} = "/mnt";
> That will set the environment variable that is passed to any
> subshells (such as system calls).  Executing a system(setenv...) is kind
> of like a noop, since the shell sets it and then exists...so it
> disappears.
>
> 2.  The system command will return as soon as the command it calls
> returns.  So if you run an application which forks off and detaches from
> the parent process it will return immediately.  There really isn't a
> "good" way to deal with this.  Perhaps if the process returned it's PID
> after the fork you could look for it and then keep looking and waiting for
> it (I don't think waitpid would work for you here, since you won't get a
> signal from a process that isn't a child of yours when it exits).
>
> I suspect if you fork() and then run you'll have the same issue if the
> underlying application forks off on it's own.
>
> In general, the system command is what you are looking for...for your
> special case things might be a bit more difficult.
>
> Hope that helps.
>
> Chander
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: waitpid

2003-01-15 Thread Mark Goland
> > system("cat cab.??|tar vxz -C ${DESTDIR}");
>
> Here your "${DESTDIR}" is being interpolated to use perl's DESTDIR
variable instead of the shell's.  Is this what you intended (is it even set,
are you running with strict and warnings?)  Other than that it should be
working I believe.  Are you getting an error result? You should check for
one by adding an 'or die ("Couldn't tar files: $!")' or some such to the
system call, or check the return value ($?).

 yeh I know, I didnt want to write an ungly system call, this is what I
am really using.
system("cat cab.??|tar vxz -C \$\{DESTDIR\}");

following up on ...> Remember your script runs in Perl not in the shell, you
run the perl interpreter in the shell, and I believe Perl uses whatever
shell is default on the system for how to run its "system" calls, aka most
likely /bin/sh (which could be pointed to tcsh, but may not)<...
 I will probebly go with expanding a variable set with in my script. By the
way is there a way to find which shell is default, I am developing on
FreeBSD and sh is the default shell, but I will be runing these scripts as
root, and tcsh is the default root shell, this would be of segnificance.

>To maintain the shell's environment if this can't be handled in Perl, you
may be able to string commands together in one >command to system separated
by ;'s like on the command line, but this I am not sure about.

 will look into that.

Thanx,
Mark


- Original Message -
From: <[EMAIL PROTECTED]>
To: "Mark Goland" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 2:04 PM
Subject: RE: waitpid


>
> 
> On Wed, 15 Jan 2003 12:55:39 -0500, Mark Goland <[EMAIL PROTECTED]>
wrote:
>
> > Hello Perl lovers,
> >
> >  I am developing a script which runs in TCSH 6.x shell. I have two
questions
> >
>
> Remember your script runs in Perl not in the shell, you run the perl
interpreter in the shell, and I believe Perl uses whatever shell is default
on the system for how to run its "system" calls, aka most likely /bin/sh
(which could be pointed to tcsh, but may not).
>
> > 1.  I need to be able to set an global enviernment variable. The shell
has a
> > build in command setenv which would enable me to do what I need. This is
> > what I try,
> >
> > system("setenv DESTDIR /mnt");
> >
>
> This is most likely succeeding (assuming the shell accepts it all) but I
would imagine the shell is started, the command is run, and the shell is
closed. So your subsequent call to the shell will be invoked in a new
instance of the environment, without what you set. But it appears there is
no reason to use this, at least not in this code segment, see below.
>
>
> > ...but this fails , by hand in works great. Source has the same problme.
Any
> > ideas ???
> >
> > 2. I need to run a few external commands sequantialy. Run one  wait on
it to
> > compleate run the others a sample command would be
> >
> > system("cat cab.??|tar vxz -C ${DESTDIR}");
>
> Here your "${DESTDIR}" is being interpolated to use perl's DESTDIR
variable instead of the shell's.  Is this what you intended (is it even set,
are you running with strict and warnings?)  Other than that it should be
working I believe.  Are you getting an error result? You should check for
one by adding an 'or die ("Couldn't tar files: $!")' or some such to the
system call, or check the return value ($?).
>
> >
> >  In C I would usually fork and waitpid on child, I was wondering if
there is
> > a short trick to this in Perl. ( I know IPC::OpenX returns pid and I can
do
> > a waitpid on it ) .
> >
>
> How do you mean "short trick" ... it seems IPC::OpenX would be the short
trick, the normal way will work as you mentioned, to fork, and then waitpid
on that child, of course within that fork you are probably still looking at
doing a 'system'.  'system' just encapsulates the fork/waitpid process for
you, so you don't gain anything by first forking. To maintain the shell's
environment if this can't be handled in Perl, you may be able to string
commands together in one command to system separated by ;'s like on the
command line, but this I am not sure about.
>
> HTH a little, Good luck...
>
> http://danconia.org
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread John W. Krahn
Mike Liss wrote:
> 
> Sorry for the confusing post, here is a little better explanation:
> 
> I am trying to create multi-dimensional arrays
> 
> $MyArray[ 2 ][];
> 
> So I can do this:
> 
> $MyArray[ 0 ][ 0 ] = 2;
> $MyArray[ 0 ][ 1 ] = 3;

  $MyArray[ 0 ] = [ 2, 3 ];

Or:

  @{$MyArray[ 0 ]} = ( 2, 3 );


> $MyArray[ 0 ][ 0 ] = 4;
> $MyArray[ 1 ][ 1 ] = 5;
> $MyArray[ 2 ][ 2 ] = 6;

  $MyArray[ 1 ] = [ 4, 5, 6 ];

Or:

  @{$MyArray[ 1 ]} = ( 4, 5, 6 );


> But what I really want to do is this :
> 
> push( @MyArray[0], 2 );
> push( @MyArray[0], 3 );

  push @{$MyArray[0]}, 2, 3;


> push( @MyArray[1], 4 );
> push( @MyArray[1], 5 );
> push( @MyArray[1], 6 );

  push @{$MyArray[1]}, 4, 5, 6;




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: question regarding a query agains a text file

2003-01-15 Thread John W. Krahn
Le Blanc wrote:
> 
> Greetings,

Hello,

> Here is my question. In the below code I have the user enter in a
> part number and revision. These are then written into a text file.
> All this works as it should. The next step that I want to get to is
> this. When the user enters the part number and revision I would like
> the script to first look at the text file and see if the number already
> exists. If it does, I then want any information that follows that number
> to be outputted to the screen. If the number does not exist then I want
> the script to write it to the text file. I hope this is clear. When it
> outtputs to the screen I need a way to tell it what part of the text
> file to actually print. I do not want the whole file to print.
> So in a nutshell, how can I have it look at the text file for the part
> number and then print out the information.

If your part numbers are unique then you should probably be using a hash
tied to a DB file.  If the text file is static then you should create an
index to look up the sections you want to display.


> I know that the code does not look pretty, but I am learning. I will
> eventually learn to format it more properly. Thank you for your help.
> 
> 
> print "What is the Part Number that you would like to look up?\n";
> my $PartNumber = ;
> chomp($PartNumber);
> while (!$PartNumber){ ## while $PartNumber is empty keep asking
>print "PartNumber? ";
>$PartNumber = ;
>chomp($PartNumber);
> }

No reason to duplicate all that code:

print "What is the Part Number that you would like to look up?\n";
my $PartNumber;
do  {
print "PartNumber? ";
chomp( $PartNumber =  );
} until $PartNumber;  ## while $PartNumber is empty keep asking


> print "What is the Revision level for $PartNumber?\n";
> my $Revision = ;
> chomp($Revision);
> while (!$Revision){ ## while $Revision is empty keep asking
>print "Revision? ";
>$Revision = ;
>chomp($Revision);
> }


print "What is the Revision level for $PartNumber?\n";
my $Revision;
do  {
print "Revision? ";
chomp( $Revision =  );
} until $Revision;  ## while $Revision is empty keep asking


> open(FILE, '>>fai.txt') ||  die $!;
> printf FILE "\t$PartNumber Rev. $Revision\t";
> close(FILE);

use DB_File;

tie my %hash, 'DB_File', 'db_filename';

$hash{ $PartNumber } = $Revision;

untie %hash;




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Escaping Ampersands in XML

2003-01-15 Thread Toby Stuart


> -Original Message-
> From: Ben Siders [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 7:38 AM
> To: Perl
> Subject: Escaping Ampersands in XML
> 
> 
> I've got a real easy one here (in theory).  I have some XML 
> files that 
> were generated by a program, but generated imperfectly.  There's some 
> naked ampersands that need to be converted to &.  I need a regexp 
> that will detect them and change them.  Sounds easy enough.
> 
> The pattern I want to match is an ampersand that is NOT immediately 
> followed by a few characters and then a semicolon.  Any ideas?
> 
> This is the best I've come up with so far.  It should match 
> an ampersand 
> whose following characters, up to five, are not semicolons.  I don't 
> feel that this is a great solution.  I'm hoping the community 
> can think 
> of a better one.
> 
> $line =~ s/\&[^;]{,5}/\&/g;

Try this one:

  s/&(?!\w+;)/&/g



> 
> I'm hoping that'll match something like:  "Blah data 
> &", but 
> NOT match "Blah &".
> 
> I'm not sure if I'm on the right track here.  I also can't 
> match other 
> escaped characters such as: "Copyright © 2003".
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Rob Dixon
Rob Dixon wrote:
> If you want to use push, pop, shift, unshift etc then do
>
> push @$MyArray[$i], $val

Sorry:

push @{$MyArray[$i]}, $val
>
> which (if the array was previously empty) will set $MyArray[$i][0] to
> $val.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Rob Dixon
Mike Liss wrote:
> I am trying to create multi-dimensional arrays
>
> $MyArray[ 2 ][];
>

That's meaningless in Perl, but anyway...

>
> So I can do this:
>
> $MyArray[ 0 ][ 0 ] = 2;
> $MyArray[ 0 ][ 1 ] = 3;
>
> $MyArray[ 0 ][ 0 ] = 4;
> $MyArray[ 1 ][ 1 ] = 5;
> $MyArray[ 2 ][ 2 ] = 6;
>
>
> But what I really want to do is this :
>
> push( @MyArray[0], 2 );
> push( @MyArray[0], 3 );
>
> push( @MyArray[1], 4 );
> push( @MyArray[1], 5 );
> push( @MyArray[1], 6 );

Like this:

push @{$MyArray[0]}, 2;
push @{$MyArray[0]}, 3;

push @{$MyArray[1]}, 4;
push @{$MyArray[1]}, 5;
push @{$MyArray[1]}, 6;

>
>
> Which will eventually result in this:
>
> print " $MyArray[ 0 ][ 0 ] \n";
> print " $MyArray[ 0 ][ 1 ] \n";
>
> print " $MyArray[ 1 ][ 0 ] \n";
> print " $MyArray[ 1 ][ 1 ] \n";
> print " $MyArray[ 1 ][ 2 ] \n";

HTH,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread John W. Krahn
Mike Liss wrote:
> 
> Hello,

Hello,

> I would like to know if it is possible to do somthing like this:
> 
> ( I know I can't do it this way as Perl barfs when I tried it )
> 
> 
> $SizeOfMyArray = 2;
> 
> $MyArray[ $SizeOfMyArray ];

If you want to pre-allocate the array size the proper way to do it is:

$#MyArray = 1;  # pre-allocate a two element array (elements 0 and 1)

Although you usually don't need to as perl will grow the array as
needed.


> push( @MyArray[ 0 ],  0 ); << --- complains here with < ERROR > (see
> below )
> push( @MyArray[ 1 ],  5 );

push (and pop and shift and unshift and splice) only work on arrays not
slices or lists.  You probably want:

$MyArray[ 0 ] = 0;  # assign literals to scalars
$MyArray[ 1 ] = 5;

Or simply:

@MyArray[ 0, 1 ] = ( 0, 5 );  # assign list to array slice

Or if you must use push:

push @MyArray, 0, 5;  # add two elements to the end of the array

Or another way to do the second example above:

splice @MyArray, 0, 2, ( 0, 5 );




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Rob Dixon
Mike Liss wrote:
> I am trying to create a multi-dimensional array
>
> $MyArray[ $SizeOfMyArray ];
>

You don't do that in Perl. There is no equivalent to BASIC's DIM
statement.

>
> So I can do this:
>
> print " $MyArray[ 0 ][ 0 ] \n";

You can do exactly that if you want to. The array will automatically
extend to whatever indices you use.

>
> And what I want to do is add items to the array dynamically

If you want to use push, pop, shift, unshift etc then do

push @$MyArray[$i], $val

which (if the array was previously empty) will set $MyArray[$i][0] to
$val.

Anything else you need?

Cheers,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread david
Mike Liss wrote:

> 
> I am trying to create a multi-dimensional array
> 
> $MyArray[ $SizeOfMyArray ];
> 
> So I can do this:
> 
> print " $MyArray[ 0 ][ 0 ] \n";
> 
> 
> And what I want to do is add items to the array dynamically

in Perl, multi-dimensional array is usually implemented with array 
reference:

#!/usr/bin/perl -w
use strict;

#--
#-- $h is a reference to an unamed array and each of
#-- the elements in $h is also reference to
#-- unamed array reference. this sort of give you
#-- the feeling of having a muli-dimensional array
#--
my $h = [[1..5],[2..6]];

#--
#-- in Perl, there are a lot of notation to access
#-- each individual element in an array reference.
#-- the following are some of the popular notations.
#-- i am not even trying to show you the others.
#-- they are pretty much the same so just pick your
#-- choice.
#--
#-- the following all prints the number 3 which is
#-- the third (2) element in the first (0) array 
#-- reference
#--
print <[0]->[2]
$h->[0][2]
@{@{$h}[0]}[2]
@$h[0]->[2]
ARRAY

#--
#-- you mention that you want to add elements to
#-- the array, the following 2 push statment does 
#-- just that. again, there are tons of other 
#-- notation for doing the same thing
#--
#-- the push statment always puts the newly added
#-- element to the end of the array. if you need
#-- to add the element to another index, just refer
#-- back to the above notations. i am sure you know
#-- what to do :-)
#--
push(@{$h->[0]},99);
push(@{$h->[1]},100);

#--
#-- the following prints the whole array reference out
#-- and confirm that 99 and 100 are indeeded added to the
#-- end of the array reference
#--
print "@{$h->[0]}\n";
print "@{@{$h}[1]}\n";

__END__

you also mention that you want to be able to access your multi-dimensiontal 
array like:

$my_array[0][0];

if you really perfer that style, try something like:

my @my_array = ([1..5],[2..6]);

print $my_array[0][0],"\n";

to add to it:

push(@{$my_array[0]},99);

or:

$my_array[0][5] = 99;

it's all about reference. read it. i think i write more than i used to today 
:-)

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Mark Anderson

> But what I really want to do is this :
>
>   push( @MyArray[0], 2 );
>   push( @MyArray[0], 3 );
>
>   push( @MyArray[1], 4 );
>   push( @MyArray[1], 5 );
>   push( @MyArray[1], 6 );

I apologize.  My first response was incorrect.  You need:

push( @{$MyArray[0]}, 2 );
push( @{$MyArray[0]}, 3 );

push( @{$MyArray[1]}, 4 );
push( @{$MyArray[1]}, 5 );
push( @{$MyArray[1]}, 6 );

/\/\ark

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Liss, Mike
Sorry for the confusing post, here is a little better explanation:


I am trying to create multi-dimensional arrays

$MyArray[ 2 ][];  


So I can do this:

$MyArray[ 0 ][ 0 ] = 2;
$MyArray[ 0 ][ 1 ] = 3;

$MyArray[ 0 ][ 0 ] = 4;
$MyArray[ 1 ][ 1 ] = 5;
$MyArray[ 2 ][ 2 ] = 6;

But what I really want to do is this :

push( @MyArray[0], 2 );
push( @MyArray[0], 3 );

push( @MyArray[1], 4 );
push( @MyArray[1], 5 );
push( @MyArray[1], 6 );


Which will eventually result in this:

print " $MyArray[ 0 ][ 0 ] \n";
print " $MyArray[ 0 ][ 1 ] \n";

print " $MyArray[ 1 ][ 0 ] \n";
print " $MyArray[ 1 ][ 1 ] \n";
print " $MyArray[ 1 ][ 2 ] \n";



But the push statements are barfing


Mike






RE: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Dan Muey
Do you mean a hash or a hash or arrays?

%hash = ( key => value,
key2 => value2
);

%hash_of_array = (
key => "list1,list2,list3",
key2 => "list1,list2,list3"
)

Those are pretty easy to work with if that's what you're needing.

>That would be much easier to work with if I understand what your trying to do
I agree. What are you doing exactly?

Making a list of ??? And trying to ??? With it?


> -Original Message-
> From: Liss, Mike [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 3:59 PM
> To: 'Mark Anderson'; [EMAIL PROTECTED]
> Subject: RE: Adding to multi-dimensional array dynamically via push...
> 
> 
> 
> I am trying to create a multi-dimensional array
> 
>   $MyArray[ $SizeOfMyArray ];
> 
> So I can do this:
> 
>   print " $MyArray[ 0 ][ 0 ] \n";
> 
> 
> And what I want to do is add items to the array dynamically
> 
> 
> 
> 
> 
> 
> -Original Message-
> From: Mark Anderson [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 1:47 PM
> To: Liss, Mike; [EMAIL PROTECTED]
> Subject: RE: Adding to multi-dimensional array dynamically via push...
> 
> 
> 
> > I would like to know if it is possible to do somthing like this: ( I
> > know I can't do it this way as Perl barfs when I tried it )
> >
> > $SizeOfMyArray = 2;
> >
> > $MyArray[ $SizeOfMyArray ];
> 
> Why are you trying to define the size of your array?
> 
> > push( @MyArray[ 0 ],  0 ); << --- complains here 
> with < ERROR >
> (see below )
> 
> What are you trying to do?  Assign '0' to the first position 
> of the array, or push 0 onto the array in the first position 
> of the array?
> 
> The first would look like:
> $MyArray[0]=0;
> The second would look like:
> push ($MyArray[0],0);
> 
> > push( @MyArray[ 1 ],  5 );
> >
> > foreach $item ( @MyArray )
> > {
> > print " Number $item \n";
> > }
> 
>   Hope this helps,
>   /\/\ark
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Liss, Mike

I am trying to create a multi-dimensional array

$MyArray[ $SizeOfMyArray ];

So I can do this:

print " $MyArray[ 0 ][ 0 ] \n";


And what I want to do is add items to the array dynamically






-Original Message-
From: Mark Anderson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 15, 2003 1:47 PM
To: Liss, Mike; [EMAIL PROTECTED]
Subject: RE: Adding to multi-dimensional array dynamically via push...



> I would like to know if it is possible to do somthing like this: ( I 
> know I can't do it this way as Perl barfs when I tried it )
>
> $SizeOfMyArray = 2;
>
> $MyArray[ $SizeOfMyArray ];

Why are you trying to define the size of your array?

> push( @MyArray[ 0 ],  0 ); << --- complains here with < ERROR >
(see below )

What are you trying to do?  Assign '0' to the first position of the array,
or push 0 onto the array in the first position of the array?

The first would look like:
$MyArray[0]=0;
The second would look like:
push ($MyArray[0],0);

> push( @MyArray[ 1 ],  5 );
>
> foreach $item ( @MyArray )
> {
> print " Number $item \n";
> }

Hope this helps,
/\/\ark



Re: pipe in perl ???

2003-01-15 Thread John W. Krahn
"Martin A. Hansen" wrote:
> 
> On Wed, Jan 15, 2003 at 05:34:59AM -0800, John W. Krahn wrote:
> > "Martin A. Hansen" wrote:
> > >
> > > how to use an array as input for a external command called within a perl script?
> > >
> > > im looking to pipe the array to the extarnal program ...
> >
> > open PIPE, '| somecommand' or die "Cannot open pipe to somecommand: $!";
> >
> > print PIPE @array;
> >
> > close PIPE or die "Cannot close pipe to somecommand: $!";
> 
> i figured that much, but that is not the way to solve my gnuplot problem. i
> need to translate the following commandline to perl:
> 
> (echo "set term post"; echo "plot '-' w l"; cat data) | gnuplot > data.ps
> 
> where "cat data" is replaced by a pipe of some sort ...
> 
> gnuplot is tricky because the "plot '-'" part means that the data is supplied
> followingly
> 
> gnuplot is wierd, but i hope perl can unwierd it


open PIPE, '| somecommand' or die "Cannot open pipe to somecommand: $!";

print PIPE "set term post\n", "plot '-' w l\n", @array;

close PIPE or die "Cannot close pipe to somecommand: $!";




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Mark Anderson

> I would like to know if it is possible to do somthing like this:
> ( I know I can't do it this way as Perl barfs when I tried it )
>
> $SizeOfMyArray = 2;
>
> $MyArray[ $SizeOfMyArray ];

Why are you trying to define the size of your array?

> push( @MyArray[ 0 ],  0 ); << --- complains here with < ERROR >
(see below )

What are you trying to do?  Assign '0' to the first position of the array,
or push 0 onto the array in the first position of the array?

The first would look like:
$MyArray[0]=0;
The second would look like:
push ($MyArray[0],0);

> push( @MyArray[ 1 ],  5 );
>
> foreach $item ( @MyArray )
> {
> print " Number $item \n";
> }

Hope this helps,
/\/\ark


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: floating-point number on the right side with sprintf

2003-01-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Konrad Foerstner wrote:
> Hi,
> 
> I have a problem with formating my output. I use sprintf to format a
> floating-point number. My output with "%.4f" looks like this:
> 
> 111.5611
> 21.4870
> 10.7046
> 8.8443
> 8.6823
> 
> but I would like to see it that way:
> 
> 111.5611
>  21.4870
>  10.7046
>   8.8443
>   8.6823
> 
> So, a kind of combination of "%.4f" and "%-8s" is needed. How can I
> do this? 
> 
> Thanks
> 
> Konrad

Just add in the width expected: %10.4f so will right justify using a max
width of 10.

Output using %10.4f:
  111.5611
   21.4870
   10.7046
8.8443
8.6823

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




floating-point number on the right side with sprintf

2003-01-15 Thread Konrad Foerstner
Hi,

I have a problem with formating my output. I use sprintf to format a
floating-point number. My output with "%.4f" looks like this:

111.5611  
21.4870  
10.7046  
8.8443  
8.6823  

but I would like to see it that way:

111.5611  
 21.4870  
 10.7046  
  8.8443  
  8.6823

So, a kind of combination of "%.4f" and "%-8s" is needed. How can I do this?

Thanks

Konrad



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Adding to multi-dimensional array dynamically via push...

2003-01-15 Thread Liss, Mike
Hello,
 
I would like to know if it is possible to do somthing like this:
 
( I know I can't do it this way as Perl barfs when I tried it )
 
 
$SizeOfMyArray = 2;
 
$MyArray[ $SizeOfMyArray ];
 
push( @MyArray[ 0 ],  0 ); << --- complains here with < ERROR > (see
below )
push( @MyArray[ 1 ],  5 );
 
foreach $item ( @MyArray )
{
print " Number $item \n";
}
 
 
< ERROR >
Type of arg 1 to push must be array (not array slice) at c:\my.pl line 122,
near "0 )"
syntax error at c:\my.pl line 125, near "$item ("
  (Might be a runaway multi-line << string starting on line 122)
Execution of c:\my.pl aborted due to compilation errors
 
 
Thanks
Mike



Escaping Ampersands in XML

2003-01-15 Thread Ben Siders
I've got a real easy one here (in theory).  I have some XML files that 
were generated by a program, but generated imperfectly.  There's some 
naked ampersands that need to be converted to &.  I need a regexp 
that will detect them and change them.  Sounds easy enough.

The pattern I want to match is an ampersand that is NOT immediately 
followed by a few characters and then a semicolon.  Any ideas?

This is the best I've come up with so far.  It should match an ampersand 
whose following characters, up to five, are not semicolons.  I don't 
feel that this is a great solution.  I'm hoping the community can think 
of a better one.

$line =~ s/\&[^;]{,5}/\&/g;

I'm hoping that'll match something like:  "Blah data &", but 
NOT match "Blah &".

I'm not sure if I'm on the right track here.  I also can't match other 
escaped characters such as: "Copyright © 2003".



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question regarding a query agains a text file

2003-01-15 Thread Dan Muey
> Kerry LeBlanc 
> Materials Auditor 
> Process Owner 
> 75 Perseverence Way 
> Hyannis, MA. 02601 
> 1-508-862-3082 
> http://www.vsf.cape.com/~bismark 
> 
> 
> 
> #make sure $part_num is formatted correctly to keep someone 
> form doing bad things with the backtick execution
> 
> I am not familiar with the term backtick so I do not really 

You can put system commands in backticks, the funny looking quote under the tilde(~), 
And execute system commands as if you had typed them at the prompt. 
Very useful but very dangerouse if somebody input some 
evil command to reformat your hardrive and tehn you have you script execute it blindly!

> understand your warning. The part number will be entered to 
> look like this: 68-2208-04 At what part of my code would I 
> put a statement like this? Would it be before the open 
> statement or replace it? Thanks
> 
> $data = `cat file.txt |grep $part_num`;
> 
> if($data) { print "Here is your info :\n$data\n"; }
> else { print info to file or whatever here }
> 
> 
> 
> You like newlines a lot don't you :)
> 
> The newlines are not permanent. I use them to space out the 
> outputs in my dos window so that I can follow it easier. They 
> will be removed. :)

Gotcha! Dos huh? The command I had above is a unix command. Not sure how you'd do that 
in winders.
You may have to open the file into an array then do a regex on each line in the array. 
Not sure, 
I don't use windows for anything but getting email,ssh inginto unix,  at work because 
I have to, and because 
I can't afford an Imac right now.

> 
> 
> Kerry
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: question regarding a query agains a text file

2003-01-15 Thread Le Blanc, Kerry (Kerry)


Kerry LeBlanc 
Materials Auditor 
Process Owner 
75 Perseverence Way 
Hyannis, MA. 02601 
1-508-862-3082 
http://www.vsf.cape.com/~bismark 



#make sure $part_num is formatted correctly to keep someone form doing bad things with 
the backtick execution

I am not familiar with the term backtick so I do not really understand your warning. 
The part number will be entered to look like this: 68-2208-04
At what part of my code would I put a statement like this? Would it be before the open 
statement or replace it?
Thanks

$data = `cat file.txt |grep $part_num`;

if($data) { print "Here is your info :\n$data\n"; }
else { print info to file or whatever here }



You like newlines a lot don't you :)

The newlines are not permanent. I use them to space out the outputs in my dos window 
so that I can follow it easier. They will be removed. :)


Kerry

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: question regarding a query agains a text file

2003-01-15 Thread Dan Muey


> -Original Message-
> From: Le Blanc, Kerry (Kerry) [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 1:39 PM
> To: '[EMAIL PROTECTED]'
> Cc: Le Blanc, Kerry (Kerry)
> Subject: question regarding a query agains a text file
> 
> 
> Greetings,
>  
> Here is my question. In the below code I have the user enter 
> in a part number and revision. These are then written into a 
> text file. All this works as it should. The next step that I 
> want to get to is this. When the user enters the part number 
> and revision I would like the script to first look at the 
> text file and see if the number already exists. If it does, I 
> then want any information that follows that number to be 
> outputted to the screen. If the number does not exist then I 
> want the script to write it to the text file. I hope this is 
> clear. When it outtputs to the screen I need a way to tell it 
> what part of the text file to actually print. I do not want 
> the whole file to print. So in a nutshell, how can I have it 
> look at the text file for the part number and then print out 

#make sure $part_num is formatted correctly to keep someone form doing bad things with 
the backtick execution

$data = `cat file.txt |grep $part_num`;

if($data) { print "Here is your info :\n$data\n"; }
else { print info to file or whatever here }

> the information. 
>  
> I know that the code does not look pretty, but I am learning. 
> I will eventually learn to format it more properly. Thank you 
> for your help.
>  
>  
> 
> print "What is the Part Number that you would like to look 
> up?\n"; my $PartNumber = ; chomp($PartNumber); while 
> (!$PartNumber){ ## while $PartNumber is empty keep asking
>print "PartNumber? ";
>$PartNumber = ;
>chomp($PartNumber);
> }
> print "What is the Revision level for $PartNumber?\n";
> my $Revision = ;
> chomp($Revision);
> while (!$Revision){ ## while $Revision is empty keep asking
>print "Revision? ";
>$Revision = ;
>chomp($Revision);
> }
>  
> 
> open(FILE, '>>fai.txt') ||  die $!;
> printf FILE "\t$PartNumber Rev. $Revision\t";
> close(FILE);
>  
> 
>  
>  
>  print "$PartNumber Rev. $Revision has a First Article 
> Report\nWould you like to view it?";
>  
> 
> my $answer = ;
> chomp($answer);
>  
> # If the answer is yes then fill the form with the information
>  
> if ($answer eq "yes") {
>print "\n\n\none second please..\n\n\n\n\n";
>print "retrieving file\n\n\n\n\n";
> }
>  
> # If the answer is no then die
>else {
> print "ok, well have a nice day.\n\n\n\n\n";
>}

You like newlines a lot don't you :)

>  
> 
>  
> 
> Kerry LeBlanc 
> Materials Auditor 
> Process Owner 
> 75 Perseverence Way 
> Hyannis, MA. 02601 
> 1-508-862-3082 
> http://www.vsf.cape.com/~bismark   
> 
>  
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Danny Grzenda
here a sub that i use.

$number = 123456 ;

$number = commify($number) ;

sub commify
{
local($_) = shift;
1 while s/^(-?\d+)(\d{3})/$1,$2/;
return $_;
}

-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 12:21 PM
To: '[EMAIL PROTECTED]'
Subject: Re: printing number with commas in it


From: "Johnson, Reginald (ECCS)" <[EMAIL PROTECTED]>
> I am trying to print a number with commas in it. I cannot find the
> correct syntax to do this with printf. I considered using the substr
> function but this depends on mealways knowing the size of the number.
> Can you help me with this?

use Interpolation NUM => 'commify';
$cost = 1245782;
print "The cost is $NUM{$cost}.\n";

or (if you do not want the .00)

use Interpolation NUM => sub {
(my $cost = reverse(shift())) =~ s/(\d{3})/$1,/g;
return scalar(reverse($cost))
};
$cost = 1245782;
print "The cost is $NUM{$cost}.\n";

(Interpolation.pm may be installed from CPAN and via PPM)

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Random Number Generation

2003-01-15 Thread Christopher D . Lewis

On Wednesday, January 15, 2003, at 08:28  AM, Maurice O'Prey wrote:

How do I extract a whole number from the rand function.


int() is your friend, if you want an integer from rand.


I am using rand 25000; which generates a random number with many 
decimal
places, e.g. 16235.2587965, I need a whole number as the answer.

&myRand = int(rand(25000) + 1);

Rand gives a number between 0 and the number you want, so if you want 
to include the end number in the range, you either need to add one to 
the result or change the argument to rand, depending on whether zero is 
in your intended range.

Sorry if
this is simple...


Not at all, this is the only kind I have a chance at getting :-)

take care,
	Chris


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




question regarding a query agains a text file

2003-01-15 Thread Le Blanc, Kerry (Kerry)
Greetings,
 
Here is my question. In the below code I have the user enter in a part number and 
revision. These are then written into a text file. All this works as it should. The 
next step that I want to get to is this. When the user enters the part number and 
revision I would like the script to first look at the text file and see if the number 
already exists. If it does, I then want any information that follows that number to be 
outputted to the screen. If the number does not exist then I want the script to write 
it to the text file. I hope this is clear. When it outtputs to the screen I need a way 
to tell it what part of the text file to actually print. I do not want the whole file 
to print.
So in a nutshell, how can I have it look at the text file for the part number and then 
print out the information. 
 
I know that the code does not look pretty, but I am learning. I will eventually learn 
to format it more properly. Thank you for your help.
 
 

print "What is the Part Number that you would like to look up?\n";
my $PartNumber = ;
chomp($PartNumber);
while (!$PartNumber){ ## while $PartNumber is empty keep asking
   print "PartNumber? ";
   $PartNumber = ;
   chomp($PartNumber);
}
print "What is the Revision level for $PartNumber?\n";
my $Revision = ;
chomp($Revision);
while (!$Revision){ ## while $Revision is empty keep asking
   print "Revision? ";
   $Revision = ;
   chomp($Revision);
}
 

open(FILE, '>>fai.txt') ||  die $!;
printf FILE "\t$PartNumber Rev. $Revision\t";
close(FILE);
 

 
 
 print "$PartNumber Rev. $Revision has a First Article Report\nWould you like to view 
it?";
 

my $answer = ;
chomp($answer);
 
# If the answer is yes then fill the form with the information
 
if ($answer eq "yes") {
   print "\n\n\none second please..\n\n\n\n\n";
   print "retrieving file\n\n\n\n\n";
}
 
# If the answer is no then die
   else {
print "ok, well have a nice day.\n\n\n\n\n";
   }
 

 

Kerry LeBlanc 
Materials Auditor 
Process Owner 
75 Perseverence Way 
Hyannis, MA. 02601 
1-508-862-3082 
http://www.vsf.cape.com/~bismark   

 



RE: Script that runs on my Win98 box and the Unix server

2003-01-15 Thread Beau E. Cox


> -Original Message-
> From: Rob Richardson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 9:05 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Script that runs on my Win98 box and the Unix server
> 
> 
> Beau,
> 
> Perhaps then my question would have been better to ask on the CGI list.
>  The script in question is a CGI script being executed through Internet
> Explorer and Apache.  When the first line of my script is "#!perl", the
> script executes as desired.  When the first line is "#!usr/bin/perl",
> the result is an Internal Server Error page and a message in the log
> file that says that the child process can't be spawned.
> 
> RobR
> 

Okay - CGI land - wheew! I thought I had really missed the boat
on my understanding of win32 cmd.com :)

Have you tried one of the following:

create a directory on your win98 box: \usr\bin

In that directory put a shortcut (do you have shortcuts on
win98?) to run perl.exe in \perl wherever

-or-

Do a similar thing with a perl.bat batch file.

If \perl (\perl\bin ?) is in your path, the perl .dlls
should be found OK.


Aloha => Beau.

> --- "Beau E. Cox" <[EMAIL PROTECTED]> wrote:
> 
> > I am really confused by your statement that on Win98 the first script
> > line is used AT ALL. On the windows platforms I have used to
> > run perl script (Win95, (maybe 98), ME, NT, 2000, XP) the system
> > has no concept of reading the script to determine what executable
> > to use. Are you using a special shell (cygwin, msys, etc.) or
> > running from the standard cmd.com? The standard windows cmd.com
> > will attempt to execute _any_ file with the extensions .exe,
> > .bat, and maybe still .com. It has no concept of the 'executable'
> > permission bit becuase the is no such thing in the Windows/DOS file
> > attributes.
> > 
> > The standard windows shell uses a file association table so that
> > an extension, say .pl, can be associated with perl.exe.
> > 
> > Please help me understand the behaviour you describe.
> > 
> > Aloha => Beau;
> > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Create Text File

2003-01-15 Thread Jakob Kofoed
Hi there,

Just another way to do it!

Cheers,
Jakob


#!/usr/bin/perl -w

open FILE, ">", yourfile.dat;

print FILE 

RE: Script that runs on my Win98 box and the Unix server

2003-01-15 Thread Rob Richardson
Beau,

Perhaps then my question would have been better to ask on the CGI list.
 The script in question is a CGI script being executed through Internet
Explorer and Apache.  When the first line of my script is "#!perl", the
script executes as desired.  When the first line is "#!usr/bin/perl",
the result is an Internal Server Error page and a message in the log
file that says that the child process can't be spawned.

RobR

--- "Beau E. Cox" <[EMAIL PROTECTED]> wrote:

> I am really confused by your statement that on Win98 the first script
> line is used AT ALL. On the windows platforms I have used to
> run perl script (Win95, (maybe 98), ME, NT, 2000, XP) the system
> has no concept of reading the script to determine what executable
> to use. Are you using a special shell (cygwin, msys, etc.) or
> running from the standard cmd.com? The standard windows cmd.com
> will attempt to execute _any_ file with the extensions .exe,
> .bat, and maybe still .com. It has no concept of the 'executable'
> permission bit becuase the is no such thing in the Windows/DOS file
> attributes.
> 
> The standard windows shell uses a file association table so that
> an extension, say .pl, can be associated with perl.exe.
> 
> Please help me understand the behaviour you describe.
> 
> Aloha => Beau;
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Checking to see if input has valid data.

2003-01-15 Thread Ben Siders
The quest for an email validation script is becoming ancient and 
legendary.  I'm sure somebody else already has sounded off on this, but 
the short answer is that there's no sure-way to validate email.  There's 
any number of potential problems:

1. The email address does not conform to the RFC
2. The email address conforms but is not deliverable.
3. The email address conforms but does not exist.
4. The address conforms but does not belong to the person who submitted it.
5. The address may be technically invalid but still deliverable in practice.

If you just want a regular expression to validate that the string looks 
like email, that's fairly straightforward.  In my opinion, the best you 
can do is validate that the username doesn't contain illegal characters, 
it's followed by an '@' and the suffix is properly formed.

Dylan Boudreau wrote:

The input must be an email address and I am checking it the following
way:

 print "Enter an address to replace: ";
 chomp (my $search = );
   unless ($search =~ /@/){
   die "Search field must be an email address!\n";
   }
 print "Enter a replacement address: ";
 chomp (my $replace = );
   unless ($replace =~ /@/){
   die "Replacement field must be an email address!\n";
   }

This does work but I am sure there must be a better way.  The whole
program is a search and replace utility for email addresses on all our
mailing lists so when someone changes their address I don't need to
change it manually on 20 lists.  Does anyone see a better way of doing
this?

Dylan

 




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: waitpid

2003-01-15 Thread wiggins


On Wed, 15 Jan 2003 12:55:39 -0500, Mark Goland <[EMAIL PROTECTED]> wrote:

> Hello Perl lovers,
> 
>  I am developing a script which runs in TCSH 6.x shell. I have two questions
> 

Remember your script runs in Perl not in the shell, you run the perl interpreter in 
the shell, and I believe Perl uses whatever shell is default on the system for how to 
run its "system" calls, aka most likely /bin/sh (which could be pointed to tcsh, but 
may not).

> 1.  I need to be able to set an global enviernment variable. The shell has a
> build in command setenv which would enable me to do what I need. This is
> what I try,
> 
> system("setenv DESTDIR /mnt");
> 

This is most likely succeeding (assuming the shell accepts it all) but I would imagine 
the shell is started, the command is run, and the shell is closed. So your subsequent 
call to the shell will be invoked in a new instance of the environment, without what 
you set. But it appears there is no reason to use this, at least not in this code 
segment, see below.


> ...but this fails , by hand in works great. Source has the same problme. Any
> ideas ???
> 
> 2. I need to run a few external commands sequantialy. Run one  wait on it to
> compleate run the others a sample command would be
> 
> system("cat cab.??|tar vxz -C ${DESTDIR}");

Here your "${DESTDIR}" is being interpolated to use perl's DESTDIR variable instead of 
the shell's.  Is this what you intended (is it even set, are you running with strict 
and warnings?)  Other than that it should be working I believe.  Are you getting an 
error result? You should check for one by adding an 'or die ("Couldn't tar files: 
$!")' or some such to the system call, or check the return value ($?).

> 
>  In C I would usually fork and waitpid on child, I was wondering if there is
> a short trick to this in Perl. ( I know IPC::OpenX returns pid and I can do
> a waitpid on it ) .
> 

How do you mean "short trick" ... it seems IPC::OpenX would be the short trick, the 
normal way will work as you mentioned, to fork, and then waitpid on that child, of 
course within that fork you are probably still looking at doing a 'system'.  'system' 
just encapsulates the fork/waitpid process for you, so you don't gain anything by 
first forking. To maintain the shell's environment if this can't be handled in Perl, 
you may be able to string commands together in one command to system separated by ;'s 
like on the command line, but this I am not sure about.

HTH a little, Good luck...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Script that runs on my Win98 box and the Unix server

2003-01-15 Thread Beau E. Cox
Hi -

> -Original Message-
> From: Rob Richardson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 8:23 AM
> To: [EMAIL PROTECTED]
> Subject: Script that runs on my Win98 box and the Unix server
>
>
> Greetings!
>
> I have been using my Win98 box to modify some scripts that will be run
> on a Unix server.  Within the body of the script, I can surround
> OS-specific things like test code I want my machine to execute and
> calls that throw errors under Win98 like flock() with checks to see
> what operating system I am using.
>
> But is there a way to differentiate between the two operating systems
> on the first line?
>
> On my box, it's "#!perl".  On the Unix box, it's "#!usr/bin/perl".
> What I'll probably end up doing is uninstalling Perl from my box and
> reinstalling it in a folder named usr/bin, but I'd rather not do that.
> Is there any way I can have two different paths to the Perl executable,
> and let my script decide which to use?
>
> On the face of it, this looks like a ridiculous question.  How can the
> Perl executable decide where the Perl executable is before Perl starts
> executing?  But maybe there's some trick with the registry or
> environmental variables or something that will help.
>
> RobR
>

I am really confused by your statement that on Win98 the first script
line is used AT ALL. On the windows platforms I have used to
run perl script (Win95, (maybe 98), ME, NT, 2000, XP) the system
has no concept of reading the script to determine what executable
to use. Are you using a special shell (cygwin, msys, etc.) or
running from the standard cmd.com? The standard windows cmd.com
will attempt to execute _any_ file with the extensions .exe,
.bat, and maybe still .com. It has no concept of the 'executable'
permission bit becuase the is no such thing in the Windows/DOS file
attributes.

The standard windows shell uses a file association table so that
an extension, say .pl, can be associated with perl.exe.

Please help me understand the behaviour you describe.

Aloha => Beau;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: waitpid

2003-01-15 Thread Mark Goland
> 2. system ($cmd) and `$cmd` do _wait_ for the command to
> finish before returing (the difference being system retuns
> the command's return code and `` returns the output). A
> series of these should do what you want.
thats what I though, but aparently thats not the case. This maybe do
to a fact that I am starting a child which in return starts a child, hance I
create grandchild. So I dont think system waits fro grandkids to compleate.
after I extract a given cab I need to configure it. So what ends up
happening is that my configure script ends up runing before the cab is
extracted.

Mark

- Original Message -
From: "Beau E. Cox" <[EMAIL PROTECTED]>
To: "Mark Goland" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 1:34 PM
Subject: RE: waitpid


> Hi -
>
> > -Original Message-
> > From: Mark Goland [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 15, 2003 7:56 AM
> > To: perl
> > Subject: waitpid
> >
> >
> > Hello Perl lovers,
> >
> >  I am developing a script which runs in TCSH 6.x shell. I have
> > two questions
> >
> > 1.  I need to be able to set an global enviernment variable. The
> > shell has a
> > build in command setenv which would enable me to do what I need. This is
> > what I try,
> >
> > system("setenv DESTDIR /mnt");
> >
> > ...but this fails , by hand in works great. Source has the same
> > problme. Any
> > ideas ???
> >
> > 2. I need to run a few external commands sequantialy. Run one
> > wait on it to
> > compleate run the others a sample command would be
> >
> > system("cat cab.??|tar vxz -C ${DESTDIR}");
> >
> >  In C I would usually fork and waitpid on child, I was wondering
> > if there is
> > a short trick to this in Perl. ( I know IPC::OpenX returns pid
> > and I can do
> > a waitpid on it ) .
> >
> > Thanx in advance,
> > Mark
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> 1. ???
> 2. system ($cmd) and `$cmd` do _wait_ for the command to
> finish before returing (the difference being system retuns
> the command's return code and `` returns the output). A
> series of these should do what you want.
>
> Aloha => Beau;
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How 'global' are STDIN/STDOUT/STDERR?

2003-01-15 Thread Mark Goland
> Thanks Mark - I thought maybe that was the case...
> well now I have to evaluate the performance penality
> and look into my other options, Aloha => Beau;

Good Luck, if Threads are well implemented they should be flying fast in
general.

Mark
- Original Message -
From: "Beau E. Cox" <[EMAIL PROTECTED]>
To: "Mark Goland" <[EMAIL PROTECTED]>
Cc: "perl" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 1:27 PM
Subject: RE: How 'global' are STDIN/STDOUT/STDERR?


> Thanks Mark - I thought maybe that was the case...
> well now I have to evaluate the performance penality
> and look into my other options, Aloha => Beau;
>
> > -Original Message-
> > From: Mark Goland [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 15, 2003 7:43 AM
> > To: Beau E. Cox
> > Cc: perl
> > Subject: Re: How 'global' are STDIN/STDOUT/STDERR?
> >
> >
> > Threads share U area , thats where file descripters are stored for your
> > process. All threads are in one process. I sedjest using semaphors for
> > contolling access to any resources.
> >
> > Mark
> > - Original Message -
> > From: "Beau E. Cox" <[EMAIL PROTECTED]>
> > To: "'Beginners" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 15, 2003 4:41 AM
> > Subject: How 'global' are STDIN/STDOUT/STDERR?
> >
> >
> > > Hi all -
> > >
> > > I am developing a perl 5.8 application using the
> > > new threading model. I use this technique
> > > (thanks Jenda!) to dup STDIN to a temp file handle:
> > >   ...
> > >   open SAVIN, '<&STDIN';
> > >   open (STDIN,'<&' . $tmpfh->fileno) or die "...";
> > >   my $out = `some-command 2>&1`;
> > >   open STDIN, '<&SAVIN';
> > >   close $tmpfh;
> > >   ...
> > > in various threads. All works - the command run
> > > reads from STDIN and output to STDOUT (maybe
> > > STDERR also). I get the output in $out.
> > >
> > > My question: how 'global' is STDIN? Must I place
> > > a lock on some dummy shared variable when using
> > > STDIN in a thread, in other words, will all
> > > threads 'see' the dup of STDIN?
> > >
> > > Aloha => Beau;
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: waitpid

2003-01-15 Thread Beau E. Cox
Hi -

> -Original Message-
> From: Mark Goland [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 7:56 AM
> To: perl
> Subject: waitpid
> 
> 
> Hello Perl lovers,
> 
>  I am developing a script which runs in TCSH 6.x shell. I have 
> two questions
> 
> 1.  I need to be able to set an global enviernment variable. The 
> shell has a
> build in command setenv which would enable me to do what I need. This is
> what I try,
> 
> system("setenv DESTDIR /mnt");
> 
> ...but this fails , by hand in works great. Source has the same 
> problme. Any
> ideas ???
> 
> 2. I need to run a few external commands sequantialy. Run one  
> wait on it to
> compleate run the others a sample command would be
> 
> system("cat cab.??|tar vxz -C ${DESTDIR}");
> 
>  In C I would usually fork and waitpid on child, I was wondering 
> if there is
> a short trick to this in Perl. ( I know IPC::OpenX returns pid 
> and I can do
> a waitpid on it ) .
> 
> Thanx in advance,
> Mark
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

1. ???
2. system ($cmd) and `$cmd` do _wait_ for the command to 
finish before returing (the difference being system retuns
the command's return code and `` returns the output). A
series of these should do what you want.

Aloha => Beau;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How 'global' are STDIN/STDOUT/STDERR?

2003-01-15 Thread Beau E. Cox
Thanks Mark - I thought maybe that was the case...
well now I have to evaluate the performance penality
and look into my other options, Aloha => Beau;

> -Original Message-
> From: Mark Goland [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 7:43 AM
> To: Beau E. Cox
> Cc: perl
> Subject: Re: How 'global' are STDIN/STDOUT/STDERR?
> 
> 
> Threads share U area , thats where file descripters are stored for your
> process. All threads are in one process. I sedjest using semaphors for
> contolling access to any resources.
> 
> Mark
> - Original Message -
> From: "Beau E. Cox" <[EMAIL PROTECTED]>
> To: "'Beginners" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 4:41 AM
> Subject: How 'global' are STDIN/STDOUT/STDERR?
> 
> 
> > Hi all -
> >
> > I am developing a perl 5.8 application using the
> > new threading model. I use this technique
> > (thanks Jenda!) to dup STDIN to a temp file handle:
> >   ...
> >   open SAVIN, '<&STDIN';
> >   open (STDIN,'<&' . $tmpfh->fileno) or die "...";
> >   my $out = `some-command 2>&1`;
> >   open STDIN, '<&SAVIN';
> >   close $tmpfh;
> >   ...
> > in various threads. All works - the command run
> > reads from STDIN and output to STDOUT (maybe
> > STDERR also). I get the output in $out.
> >
> > My question: how 'global' is STDIN? Must I place
> > a lock on some dummy shared variable when using
> > STDIN in a thread, in other words, will all
> > threads 'see' the dup of STDIN?
> >
> > Aloha => Beau;
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Script that runs on my Win98 box and the Unix server

2003-01-15 Thread Rob Richardson
Greetings!

I have been using my Win98 box to modify some scripts that will be run
on a Unix server.  Within the body of the script, I can surround
OS-specific things like test code I want my machine to execute and
calls that throw errors under Win98 like flock() with checks to see
what operating system I am using.  

But is there a way to differentiate between the two operating systems
on the first line?

On my box, it's "#!perl".  On the Unix box, it's "#!usr/bin/perl". 
What I'll probably end up doing is uninstalling Perl from my box and
reinstalling it in a folder named usr/bin, but I'd rather not do that. 
Is there any way I can have two different paths to the Perl executable,
and let my script decide which to use?

On the face of it, this looks like a ridiculous question.  How can the
Perl executable decide where the Perl executable is before Perl starts
executing?  But maybe there's some trick with the registry or
environmental variables or something that will help.

RobR



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: printing number with commas in it

2003-01-15 Thread Jenda Krynicky
From: "Johnson, Reginald (ECCS)" <[EMAIL PROTECTED]>
> I am trying to print a number with commas in it. I cannot find the
> correct syntax to do this with printf. I considered using the substr
> function but this depends on mealways knowing the size of the number.
> Can you help me with this?

use Interpolation NUM => 'commify';
$cost = 1245782;
print "The cost is $NUM{$cost}.\n";

or (if you do not want the .00)

use Interpolation NUM => sub {
(my $cost = reverse(shift())) =~ s/(\d{3})/$1,/g;
return scalar(reverse($cost))
};
$cost = 1245782;
print "The cost is $NUM{$cost}.\n";

(Interpolation.pm may be installed from CPAN and via PPM)

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Local Apache Server and CGI?

2003-01-15 Thread wiggins


On Wed, 15 Jan 2003 10:47:45 -0600, "Dan Muey" <[EMAIL PROTECTED]> wrote:

> Are the .cgi scripts perl?
> 
> Is .cgi associated with perl?
> 
> Do they work if you use .pl instead?
> 
> Do they work if you run them form the dos prompt?
> 
> Are they executable ( not sure about how windows does that ) ?
> 
> Do you need the Exec cgi directive in Apache for that directory or for a cgi-bin 
>directory?
> 
> Simple solution :
> 
> Install Unix over Windows! 
> 

And one not slightly as good, install Unix *in* Windows, see: http://www.cygwin.com 
for those times when corporate mandate is windows

> That's  my solution for everything! :)
> 
> Dan
> 

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Checking to see if input has valid data.

2003-01-15 Thread [EMAIL PROTECTED]
I use this for email verification

$str =~ /^[^@]+@[^.]+\.[^.]/);


- Original Message - 
From: "Dylan Boudreau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 11:57 AM
Subject: Checking to see if input has valid data.


> The input must be an email address and I am checking it the following
> way:
>  
>   print "Enter an address to replace: ";
>   chomp (my $search = );
> unless ($search =~ /@/){
> die "Search field must be an email address!\n";
> }
>   print "Enter a replacement address: ";
>   chomp (my $replace = );
> unless ($replace =~ /@/){
> die "Replacement field must be an email address!\n";
> }
>  
> This does work but I am sure there must be a better way.  The whole
> program is a search and replace utility for email addresses on all our
> mailing lists so when someone changes their address I don't need to
> change it manually on 20 lists.  Does anyone see a better way of doing
> this?
>  
> Dylan
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: ppm: No suitable installation target for package G

2003-01-15 Thread Jenda Krynicky
From: "David Eason" <[EMAIL PROTECTED]>
> Thanks! Now I have another problem.
> 
> Is there a ppm repository for File-DosGlob or do I need to figure out
> how to get the cpan shell working in Windows?

File::DosGlob is part of the core.
I've removed the dependency from the .ppd file, could you try to 
install the module once more?
(I did try before using ActivePerl 804 and it DID work!)

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




waitpid

2003-01-15 Thread Mark Goland
Hello Perl lovers,

 I am developing a script which runs in TCSH 6.x shell. I have two questions

1.  I need to be able to set an global enviernment variable. The shell has a
build in command setenv which would enable me to do what I need. This is
what I try,

system("setenv DESTDIR /mnt");

...but this fails , by hand in works great. Source has the same problme. Any
ideas ???

2. I need to run a few external commands sequantialy. Run one  wait on it to
compleate run the others a sample command would be

system("cat cab.??|tar vxz -C ${DESTDIR}");

 In C I would usually fork and waitpid on child, I was wondering if there is
a short trick to this in Perl. ( I know IPC::OpenX returns pid and I can do
a waitpid on it ) .

Thanx in advance,
Mark


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How 'global' are STDIN/STDOUT/STDERR?

2003-01-15 Thread Mark Goland
Threads share U area , thats where file descripters are stored for your
process. All threads are in one process. I sedjest using semaphors for
contolling access to any resources.

Mark
- Original Message -
From: "Beau E. Cox" <[EMAIL PROTECTED]>
To: "'Beginners" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 4:41 AM
Subject: How 'global' are STDIN/STDOUT/STDERR?


> Hi all -
>
> I am developing a perl 5.8 application using the
> new threading model. I use this technique
> (thanks Jenda!) to dup STDIN to a temp file handle:
>   ...
>   open SAVIN, '<&STDIN';
>   open (STDIN,'<&' . $tmpfh->fileno) or die "...";
>   my $out = `some-command 2>&1`;
>   open STDIN, '<&SAVIN';
>   close $tmpfh;
>   ...
> in various threads. All works - the command run
> reads from STDIN and output to STDOUT (maybe
> STDERR also). I get the output in $out.
>
> My question: how 'global' is STDIN? Must I place
> a lock on some dummy shared variable when using
> STDIN in a thread, in other words, will all
> threads 'see' the dup of STDIN?
>
> Aloha => Beau;
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Dan Muey

> There is a pink and a blue camel book from O'Reilly.  What is 
> the difference, and which comes most highly recommended?

One is for boys and one is for girls. 
Sorry I couldn't resist!
Are they the same title?
If so probably the newest one would be more up to date.

> 
> Robbie

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Checking to see if input has valid data.

2003-01-15 Thread Bob Showalter
Dylan Boudreau wrote:
> The input must be an email address and I am checking it the following
> way: 

[snip]

> This does work but I am sure there must be a better way.  The whole
> program is a search and replace utility for email addresses on all our
> mailing lists so when someone changes their address I don't need to
> change it manually on 20 lists.  Does anyone see a better way of
> doing this? 

Consider Email::Valid module on CPAN:



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Ken Lehman
Pink is first edition, blue is second edition, i think there is a third
edition out now, may as well go for the latest and greatest
-Ken

-Original Message-
From: Robbie Staufer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 12:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Perl book


There is a pink and a blue camel book from O'Reilly.  What is the
difference, and which comes most highly recommended?

Robbie

--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Local Apache Server and CGI?

2003-01-15 Thread Bob Showalter
Ben Crane wrote:
> ... a simple *.cgi script
> that prints "script working" suddenly prints the
> contents of the program, i.e: apache isn't seeing
> *.cgi as a script and is dumping it as a txt file onto the browser...

You have to configure Apache through the httpd.conf to treat specific
directories or url locations as CGI scripts.

See 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Create Text File

2003-01-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello all,
> 
>   I need to create a .txt file and then print some text to it 
> Does anyone know how to do this? 
> 
> Thanks in advance...
> Kurt

By opening, printing, you will have a text file:

open(MYTEXTFILE, ">text.txt") || die "Unable to open text.txt: $!";
for(my $MyId=0;$MyId<100;$MyId++) {
 printf MYTEXTFILE "%5d\n", $MyId;
   }
  close(MYTEXTFILE);

You now have a text file.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Create Text File

2003-01-15 Thread Dan Muey

Use open() to open a file for writing and it will be created automatically.

open(FILE, '>file.txt');
print FILE $stuff;
close(FILE);

perldoc -f open



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: Create Text File
> 
> 
> Hello all,
> 
>   I need to create a .txt file and then print some text to 
> it  Does anyone know how to do this?
> 
> Thanks in advance...
> Kurt
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Create Text File

2003-01-15 Thread Paul Kraus
#!/usr/bin/perl -w

open TEXT,"mytext.txt";
print TEXT "add some text to text file\n";
print TEXT "add some more text to text file\n";
close TEXT;



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 12:06 PM
> To: [EMAIL PROTECTED]
> Subject: Create Text File
> 
> 
> Hello all,
> 
>   I need to create a .txt file and then print some text to 
> it  Does anyone know how to do this?
> 
> Thanks in advance...
> Kurt
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Checking to see if input has valid data.

2003-01-15 Thread Dan Muey
=~ m/^(\w+).*\(\w+)@(\w+).*\.(\w+)$/

Would match [EMAIL PROTECTED]
[EMAIL PROTECTED]
But not

joemama@joemam
Or [EMAIL PROTECTED]

There is even a better way to do it instead of the .* which will match

Joemama~$%&*(()_)+=-:"{}|?> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 10:58 AM
> To: [EMAIL PROTECTED]
> Subject: Checking to see if input has valid data.
> 
> 
> The input must be an email address and I am checking it the following
> way:
>  
>   print "Enter an address to replace: ";
>   chomp (my $search = );
> unless ($search =~ /@/){
> die "Search field must be an email address!\n";
> }
>   print "Enter a replacement address: ";
>   chomp (my $replace = );
> unless ($replace =~ /@/){
> die "Replacement field must be an email address!\n";
> }
>  
> This does work but I am sure there must be a better way.  The 
> whole program is a search and replace utility for email 
> addresses on all our mailing lists so when someone changes 
> their address I don't need to change it manually on 20 lists. 
>  Does anyone see a better way of doing this?
>  
> Dylan
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl book

2003-01-15 Thread Robbie Staufer
There is a pink and a blue camel book from O'Reilly.  What is the
difference, and which comes most highly recommended?

Robbie

--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Local Apache Server and CGI?

2003-01-15 Thread Dan Muey


> -Original Message-
> From: Ben Crane [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 10:55 AM
> To: Dan Muey
> Subject: RE: Local Apache Server and CGI?
> 
> 
> 
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > Are the .cgi scripts perl?
>   *YES
> > Is .cgi associated with perl?
>   *YES
> > Do they work if you use .pl instead?
>   *NO, brings up the download screen
> > Do they work if you run them form the dos prompt?
>   *YES
> > Are they executable ( not sure about how windows
> > does that ) ?
>*DONT KNOW 
> > Do you need the Exec cgi directive in Apache for
> > that directory or for a cgi-bin directory?
>*MAYBE...HOW??

On windows??? I'd say ask an apache list, they'd know better

> > Simple solution :
> > 
> > Install Unix over Windows! 
> >  ***AA CANT! / DONT WANT 2!! ;)
> 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Create Text File

2003-01-15 Thread [EMAIL PROTECTED]
Hello all,

  I need to create a .txt file and then print some text to it  Does anyone know 
how to do this?

Thanks in advance...
Kurt



RE: Perl book

2003-01-15 Thread Dan Muey
> WOW the black book is almost 70 bucks!!! BUT CHECK THIS OUT. 
> Amazon has it used for around 10 bucks with the CD woo who!!

$70? Mine was $20 but I think I got the smaller version, no CD
The big one is still pretty sexxy though from what I've seen of it
It may be worth $70 but if you can get it used for $10, super.

> 
> > -Original Message-
> > From: Dan Muey [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 15, 2003 11:25 AM
> > To: [EMAIL PROTECTED]; Dylan Boudreau; [EMAIL PROTECTED]
> > Subject: RE: Perl book
> > 
> > 
> > 
> > > 
> > > On Wed, 15 Jan 2003 11:39:04 -0400, "Dylan Boudreau" 
> > > <[EMAIL PROTECTED]> wrote:
> > > 
> > > > I am a network administrator maintaining strictly Unix
> > > boxes of some
> > > > type or another.  I want to become as proficient at Perl as
> > > I possibly
> > > > can because I see scripting as the week point on my
> > resume.  I have
> > > > the Oreilly book "Perl for System Administrators" but I
> > > want to read
> > > > another book before I get in to that one so I have a good base.
> > > > 
> > > > I think the main thing I want to get out of the next 
> book is more 
> > > > familiarity with modules because Learning Perl doesn't
> > really cover
> > > > them well at all.
> > > > 
> > > > Dylan
> > > > 
> > > 
> > > Have you been through the provided perl documentation? 
> Surprisingly 
> > > I found it incredibly helpful despite my lack of its use for the 
> > > first 4+ years of using Perl (granted I already had the other 
> > > standard issues, Camel, Cookbook, OOP Perl, DBI, XML, 
> etc.)  perldoc 
> > > perl will give you a list of goodies to try, once you understand 
> > > using CPAN, then few modules will have (or need) a book 
> devoted to 
> > > them (the exceptions already do, CGI, DBI, XML) but most 
> 90+% have 
> > > good standard documentation that is available with the module
> > > itself or online. If you start with:
> > 
> > An excellent idea I second that motion! I got all caught up in books
> > that I missed the place the books get their info! Thanks for 
> > the obvious!
> > 
> > Dan
> > 
> > > 
> > > perldoc perlmod  - Perl modules: how they work
> > > perldoc perlmodlib   - Perl modules: how to write and use
> > > perldoc perlmodinstallPerl modules: how to install from CPAN
> > > 
> > > perldoc perlreftut - Perl references short introduction
> > > perldoc perlref - Perl references, the rest 
> of the story
> > > 
> > > That will give you a great overview and then exploring any 
> > > particular module should be relatively similar to any other.
> > > 
> > http://danconia.org
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Checking to see if input has valid data.

2003-01-15 Thread Dylan Boudreau
The input must be an email address and I am checking it the following
way:
 
  print "Enter an address to replace: ";
  chomp (my $search = );
unless ($search =~ /@/){
die "Search field must be an email address!\n";
}
  print "Enter a replacement address: ";
  chomp (my $replace = );
unless ($replace =~ /@/){
die "Replacement field must be an email address!\n";
}
 
This does work but I am sure there must be a better way.  The whole
program is a search and replace utility for email addresses on all our
mailing lists so when someone changes their address I don't need to
change it manually on 20 lists.  Does anyone see a better way of doing
this?
 
Dylan



Re: Retriving a file using cgi posted from a html form

2003-01-15 Thread fliptop
On Wed, 15 Jan 2003 at 22:32, LRMK opined:

L:how do I retrieve & save files that has been posted from a Html form to
L:my cgi script.

have you read 'perldoc CGI'?

L:please send a piece of example code

from 'perldoc CGI' (for a plain text file):

 $fh = $query->upload('uploaded_file');
while (<$fh>) {
  print;
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Paul Kraus
WOW the black book is almost 70 bucks!!! BUT CHECK THIS OUT. Amazon has
it used for around 10 bucks with the CD woo who!!

> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 11:25 AM
> To: [EMAIL PROTECTED]; Dylan Boudreau; [EMAIL PROTECTED]
> Subject: RE: Perl book
> 
> 
> 
> > 
> > On Wed, 15 Jan 2003 11:39:04 -0400, "Dylan Boudreau"
> > <[EMAIL PROTECTED]> wrote:
> > 
> > > I am a network administrator maintaining strictly Unix
> > boxes of some
> > > type or another.  I want to become as proficient at Perl as
> > I possibly
> > > can because I see scripting as the week point on my 
> resume.  I have
> > > the Oreilly book "Perl for System Administrators" but I 
> > want to read
> > > another book before I get in to that one so I have a good base.
> > > 
> > > I think the main thing I want to get out of the next book is more
> > > familiarity with modules because Learning Perl doesn't 
> really cover 
> > > them well at all.
> > > 
> > > Dylan
> > > 
> > 
> > Have you been through the provided perl documentation?
> > Surprisingly I found it incredibly helpful despite my lack of 
> > its use for the first 4+ years of using Perl (granted I 
> > already had the other standard issues, Camel, Cookbook, OOP 
> > Perl, DBI, XML, etc.)  perldoc perl will give you a list of 
> > goodies to try, once you understand using CPAN, then few 
> > modules will have (or need) a book devoted to them (the 
> > exceptions already do, CGI, DBI, XML) but most 90+% have good 
> > standard documentation that is available with the module 
> > itself or online. If you start with:
> 
> An excellent idea I second that motion! I got all caught up in books 
> that I missed the place the books get their info! Thanks for 
> the obvious!
> 
> Dan
> 
> > 
> > perldoc perlmod  - Perl modules: how they work
> > perldoc perlmodlib   - Perl modules: how to write and use
> > perldoc perlmodinstallPerl modules: how to install from CPAN
> > 
> > perldoc perlreftut - Perl references short introduction
> > perldoc perlref - Perl references, the rest of the story
> > 
> > That will give you a great overview and then exploring any
> > particular module should be relatively similar to any other.
> > 
> http://danconia.org
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl book

2003-01-15 Thread Ben Siders
I generally like the O'Reilly Perl books, and I've had good luck with 
them.  I can't use them as my only Perl reference, though.  I don't pick 
up the condescending tone in them that you seem to have, but I 
definately agree that they're overrated.  The Perl books, in general, 
are excellent, but I've seen just as many O'Reilly books on other 
subjects that are horrible.  Like any book, it comes down to the 
author's command of the topic, and the skills of the editor.

About 20 minutes ago, I bumped into the 'eval' function in a context I'd 
never seen it used.  I flipped open Advanced Perl Programming and 
understood it all in a few minutes.  On the other hand, I also saw a use 
of 'unpack' this morning that I didn't understand, and I can't find an 
answer to it in any of my books.  It's probably in one of those books 
somewhere, but it's easier for me to ask a coworker or search on-line 
than to pore through the books.  As with any resource, you have to learn 
when it will and will not be helpful for your situation.

I've never heard of the Black Book series.  Did anybody post the publisher?

Dan Muey wrote:

It may be 'Perl Black Book' actually, I don't have it with me right now but I'll get the info and post it later today.

There's a whole series of 'Balck Books' for different programming languages and stuff.

An excellent reference but also better learning tools because of example situations for the more obscure and actual code examples instead of the 

funtion_name obscure_arg1,obscure_arg2
format that O'rielly seems to like.

That translates into :
"What! You don't know what this means? 
Are you stupid, you must be if you don't know this!
Because everybody just loves Orielly, everybody else 
is smart and you are dumb."

Ok done preaching, I'll post more detailed info when I can.

Thanks for putting up with my rantings everyone. 
I don't mean to insult any Orielly fans. They are great 
refernces for stuff you know but bad teachers of new things.

 

Thanks Dan,
Your assessment of the Oreilly books is pretty much in line 
with my own. I think they are a great reference if you 
already know the material and just need to looks something up 
but they are not the most descriptive when used as a learning tool.

Is the book you are referring too call "The Black Book of 
Perl" or "Perl Black Book"?  I ask because I can't find any 
instance of "The Black Book of Perl" when searching 
chapters.ca or amazon.com.

Is this book a good learning tool or more of a reference?

Thanks again,

Dylan

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 12:12 PM
To: Dylan Boudreau; [EMAIL PROTECTED]
Subject: RE: Perl book



I'd say go to the library then and check out some books 
( have them get them other libraries if they don't have them 
) and when you find one you jive with go buy it.

I love 'The Black Book of Perl' and have learned most all 
I do from it and I to do a lot of Unix Administration.

One reason I didn't jive real great with the O'reilly books 
is that the ones I 
Had available to me where sort of vague while being 
desciptive at the same time Especially with modules. 

Example :

Page 114 of 'Perl in a Nutshell'

It is describing the pack function and does so quite well and 
informative like. But if I'd never used pack before I'd have 
no idea what it is for. How am I supposed to understand what  
'taking a list of values and packing it in a binary 
structure' is supposed to mean if I've never come across it before. 

There are no examples of situations you might use this or 
samples of usage beside at the top

It has
Pack template, list

Then explains what pack does and what template and list are 
but how do you know if you are supposed to do

pack($template, @list);
Or exactly like they have it
pack $template, $list;
Or both or can I do 
Pack abBA, list

Or only one character where template is?

And I can see that for template I might use any number of 
things a,A,b,B, etc and I can even see what they mean a - An 
ASCCI string, will be null padded.

That's a great reminder if you've used this before and 
understand what 'An ASCCI string, will be null padded' means. 
What is list, an array or a string? What can it be, a file, 
input, what good would you get from using pack?

Why not thrown in : 
You may want to use pack if you are .

And have at least one example
$value = "Example Of actual data you might want to use in 
pack"; pack(a, $value);

This would return ... So that you could ...

So, to me, these books are much like Microsoft Tech Support : 
There was a helicopter flying in Seattle and it became too 
foggy to see. Desperatley tring to find out where they were 
the pilot yelled out of the window to some people in  a 
building nearby ," We're lost! Where are we?" and the people 
said, "You're in a helicopter!". The helicopter landed safely 
and the crew asked how the pilot knew where to go based on 
what those people said and he replied, "Well, I

RE: Local Apache Server and CGI?

2003-01-15 Thread Dan Muey
Are the .cgi scripts perl?

Is .cgi associated with perl?

Do they work if you use .pl instead?

Do they work if you run them form the dos prompt?

Are they executable ( not sure about how windows does that ) ?

Do you need the Exec cgi directive in Apache for that directory or for a cgi-bin 
directory?

Simple solution :

Install Unix over Windows! 

That's  my solution for everything! :)

Dan

> -Original Message-
> From: Ben Crane [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 10:39 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Local Apache Server and CGI?
> 
> 
> Hi list,
> 
> Please forgive what must be seen as amazingly naive! I
> have just managed to get an apache server loaded
> locally (so I can test my scripts/etc) without putting
> them on our corporate server all the time. Now I've
> managed to get php to work...but a simple *.cgi script
> that prints "script working" suddenly prints the
> contents of the program, i.e: apache isn't seeing
> *.cgi as a script and is dumping it as a txt file onto
> the browser...
> 
> I am using Win NT and would like to know where I can
> store my cgi scripts so they get loaded by apache?
> I've tried apache cgi-bin but I get file not found...I
> was thinking it might be under WINNT?
> 
> Any help would be appreciated, I'm just getting the
> hang of all things unix...
> 
> :)
> 
> Ben
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now. 
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Network Administration and Perl

2003-01-15 Thread Brian McGraw
1. Log into FTP and get new AV dats, if a new version is posted.
2. Securely copy logs from one network to another for analysis. (Thanks File::Remote)
3. Consolidate account creation process. (Creating accounts for services while 
creating user accounts).
4. 

>>> "Paul Kraus" <[EMAIL PROTECTED]> 01/15/03 09:08AM >>>
What are some of the ways you guys use Perl for network administration?

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com



RE: Local Apache Server and CGI?

2003-01-15 Thread Ben Crane
Hi list,

Please forgive what must be seen as amazingly naive! I
have just managed to get an apache server loaded
locally (so I can test my scripts/etc) without putting
them on our corporate server all the time. Now I've
managed to get php to work...but a simple *.cgi script
that prints "script working" suddenly prints the
contents of the program, i.e: apache isn't seeing
*.cgi as a script and is dumping it as a txt file onto
the browser...

I am using Win NT and would like to know where I can
store my cgi scripts so they get loaded by apache?
I've tried apache cgi-bin but I get file not found...I
was thinking it might be under WINNT?

Any help would be appreciated, I'm just getting the
hang of all things unix...

:)

Ben

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: OSX Aqua and Perl

2003-01-15 Thread Dan Muey

> Hi all,
> 
> Does anyone know a way of creating GUI interfaces directly 
> from Perl, that will work with OS X's native Aqua interface?


Good question! If not we need to get someone on it asap. OS X is awesome!
Unix and mac and microsoft free!!! Oh what a wonderful thing!
I've wondered this myself as the application would be unbeleivable.
I could have a my database system run as a regualr program instead of from browser, 
I could write my own mail client for OSX with all the goodies I like and none of the 
crap I hate.
Oh that would be creamy!

> 
> Thanks for any info.
> 
> Brian

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Dan Muey
It may be 'Perl Black Book' actually, I don't have it with me right now but I'll get 
the info and post it later today.

There's a whole series of 'Balck Books' for different programming languages and stuff.

An excellent reference but also better learning tools because of example situations 
for the more obscure and actual code examples instead of the 

funtion_name obscure_arg1,obscure_arg2
format that O'rielly seems to like.

That translates into :
"What! You don't know what this means? 
Are you stupid, you must be if you don't know this!
Because everybody just loves Orielly, everybody else 
is smart and you are dumb."

Ok done preaching, I'll post more detailed info when I can.

Thanks for putting up with my rantings everyone. 
I don't mean to insult any Orielly fans. They are great 
refernces for stuff you know but bad teachers of new things.

> Thanks Dan,
> Your assessment of the Oreilly books is pretty much in line 
> with my own. I think they are a great reference if you 
> already know the material and just need to looks something up 
> but they are not the most descriptive when used as a learning tool.
> 
> Is the book you are referring too call "The Black Book of 
> Perl" or "Perl Black Book"?  I ask because I can't find any 
> instance of "The Black Book of Perl" when searching 
> chapters.ca or amazon.com.
> 
> Is this book a good learning tool or more of a reference?
> 
> Thanks again,
> 
> Dylan
> 
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]] 
> Sent: January 15, 2003 12:12 PM
> To: Dylan Boudreau; [EMAIL PROTECTED]
> Subject: RE: Perl book
> 
> 
> 
> I'd say go to the library then and check out some books 
> ( have them get them other libraries if they don't have them 
> ) and when you find one you jive with go buy it.
> 
> I love 'The Black Book of Perl' and have learned most all 
> I do from it and I to do a lot of Unix Administration.
> 
> One reason I didn't jive real great with the O'reilly books 
> is that the ones I 
> Had available to me where sort of vague while being 
> desciptive at the same time Especially with modules. 
> 
> Example :
> 
> Page 114 of 'Perl in a Nutshell'
> 
> It is describing the pack function and does so quite well and 
> informative like. But if I'd never used pack before I'd have 
> no idea what it is for. How am I supposed to understand what  
> 'taking a list of values and packing it in a binary 
> structure' is supposed to mean if I've never come across it before. 
> 
> There are no examples of situations you might use this or 
> samples of usage beside at the top
> 
> It has
> Pack template, list
> 
> Then explains what pack does and what template and list are 
> but how do you know if you are supposed to do
> 
> pack($template, @list);
> Or exactly like they have it
> pack $template, $list;
> Or both or can I do 
> Pack abBA, list
> 
> Or only one character where template is?
> 
> And I can see that for template I might use any number of 
> things a,A,b,B, etc and I can even see what they mean a - An 
> ASCCI string, will be null padded.
> 
> That's a great reminder if you've used this before and 
> understand what 'An ASCCI string, will be null padded' means. 
> What is list, an array or a string? What can it be, a file, 
> input, what good would you get from using pack?
> 
> Why not thrown in : 
> You may want to use pack if you are .
> 
> And have at least one example
> $value = "Example Of actual data you might want to use in 
> pack"; pack(a, $value);
> 
> This would return ... So that you could ...
> 
> So, to me, these books are much like Microsoft Tech Support : 
> There was a helicopter flying in Seattle and it became too 
> foggy to see. Desperatley tring to find out where they were 
> the pilot yelled out of the window to some people in  a 
> building nearby ," We're lost! Where are we?" and the people 
> said, "You're in a helicopter!". The helicopter landed safely 
> and the crew asked how the pilot knew where to go based on 
> what those people said and he replied, "Well, I knew we were 
> by the Microsfot building because their answer was 
> technically correct but completely useless. ".
> 
> So basically are the Orielly books I;ve seen good books. You 
> bet, they are informative and acurate but they are very 
> difficult to learn new stuff from! 
> So instead of learning something new it kind of makes you 
> avoid learning new stuff because then you have to 
> ask a list what this or that means and risk a pummeling at 
> the ignorance you've shown!
> 
> I'd take one for free but I wouldn't pay for it. 
> 
> But that's just me.
> 
> Dan
> 
> > I am a network administrator maintaining strictly Unix 
> boxes of some 
> > type or another.  I want to become as proficient at Perl as 
> I possibly 
> > can because I see scripting as the week point on my resume.  I have 
> > the Oreilly book "Perl for System Administrators" but I 
> want to read 
> > another book before I get in to that one so I have a good bas

RE: Perl book

2003-01-15 Thread Dylan Boudreau
It is out of print according to amazon.com but if you check chapters.ca
it is listed as being available and shipped within 24 hrs.

Dylan

-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 12:21 PM
To: 'Dan Muey'; 'Dylan Boudreau'; [EMAIL PROTECTED]
Subject: RE: Perl book


According to Amazon the Perl black book is out of print. :( you got me
all hyped about checking it out :)

> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 11:12 AM
> To: Dylan Boudreau; [EMAIL PROTECTED]
> Subject: RE: Perl book
> 
> 
> 
> I'd say go to the library then and check out some books
> ( have them get them other libraries if they don't have them 
> ) and when you find one you jive with go buy it.
> 
> I love 'The Black Book of Perl' and have learned most all
> I do from it and I to do a lot of Unix Administration.
> 
> One reason I didn't jive real great with the O'reilly books
> is that the ones I 
> Had available to me where sort of vague while being 
> desciptive at the same time Especially with modules. 
> 
> Example :
> 
> Page 114 of 'Perl in a Nutshell'
> 
> It is describing the pack function and does so quite well and
> informative like. But if I'd never used pack before I'd have 
> no idea what it is for. How am I supposed to understand what  
> 'taking a list of values and packing it in a binary 
> structure' is supposed to mean if I've never come across it before. 
> 
> There are no examples of situations you might use this or
> samples of usage beside at the top
> 
> It has
> Pack template, list
> 
> Then explains what pack does and what template and list are
> but how do you know if you are supposed to do
> 
> pack($template, @list);
> Or exactly like they have it
> pack $template, $list;
> Or both or can I do
> Pack abBA, list
> 
> Or only one character where template is?
> 
> And I can see that for template I might use any number of
> things a,A,b,B, etc and I can even see what they mean a - An 
> ASCCI string, will be null padded.
> 
> That's a great reminder if you've used this before and
> understand what 'An ASCCI string, will be null padded' means. 
> What is list, an array or a string? What can it be, a file, 
> input, what good would you get from using pack?
> 
> Why not thrown in :
> You may want to use pack if you are .
> 
> And have at least one example
> $value = "Example Of actual data you might want to use in
> pack"; pack(a, $value);
> 
> This would return ... So that you could ...
> 
> So, to me, these books are much like Microsoft Tech Support :
> There was a helicopter flying in Seattle and it became too 
> foggy to see. Desperatley tring to find out where they were 
> the pilot yelled out of the window to some people in  a 
> building nearby ," We're lost! Where are we?" and the people 
> said, "You're in a helicopter!". The helicopter landed safely 
> and the crew asked how the pilot knew where to go based on 
> what those people said and he replied, "Well, I knew we were 
> by the Microsfot building because their answer was 
> technically correct but completely useless. ".
> 
> So basically are the Orielly books I;ve seen good books. You
> bet, they are informative and acurate but they are very 
> difficult to learn new stuff from! 
> So instead of learning something new it kind of makes you 
> avoid learning new stuff because then you have to 
> ask a list what this or that means and risk a pummeling at 
> the ignorance you've shown!
> 
> I'd take one for free but I wouldn't pay for it.
> 
> But that's just me.
> 
> Dan
> 
> > I am a network administrator maintaining strictly Unix boxes of some

> > type or another.  I want to become as proficient at Perl as I 
> > possibly can because I see scripting as the week point on my resume.

> > I have the Oreilly book "Perl for System Administrators" but I want 
> > to read another book before I get in to that one so I have a good 
> > base.
> > 
> > I think the main thing I want to get out of the next book is more 
> > familiarity with modules because Learning Perl doesn't really cover 
> > them well at all.
> > 
> > Dylan
> > 
> > -Original Message-
> > From: Dan Muey [mailto:[EMAIL PROTECTED]]
> > Sent: January 15, 2003 11:32 AM
> > To: Dylan Boudreau; [EMAIL PROTECTED]
> > Subject: RE: Perl book
> > 
> > 
> > The black books are very nice. I like them better than the Orielly 
> > ones.
> > 
> > Not to start a flame war, I just like em better.
> > 
> > Also there's the 'using perl' for specifci jobs, system admin, web 
> > programming, database, algorythms, etc
> > 
> > Can't remember the publisher off hand, sorry.
> > 
> > Depends on what you want to use perl for now that you've done 
> > Learning Perl.
> > 
> > You could do one of my favorite things and go into Barnes and Noble 
> > and read all of them, or check them out form the library and start 
> > it and if you don't like it take it back and get another!!
> > 
> > Basica

Retriving a file using cgi posted from a html form

2003-01-15 Thread LRMK
how do I retrieve & save files that has been posted from a Html form to my cgi script.

please send a piece of example code



RE: Perl book

2003-01-15 Thread Dan Muey

> 
> On Wed, 15 Jan 2003 11:39:04 -0400, "Dylan Boudreau" 
> <[EMAIL PROTECTED]> wrote:
> 
> > I am a network administrator maintaining strictly Unix 
> boxes of some 
> > type or another.  I want to become as proficient at Perl as 
> I possibly 
> > can because I see scripting as the week point on my resume.  I have 
> > the Oreilly book "Perl for System Administrators" but I 
> want to read 
> > another book before I get in to that one so I have a good base.
> > 
> > I think the main thing I want to get out of the next book is more 
> > familiarity with modules because Learning Perl doesn't really cover 
> > them well at all.
> > 
> > Dylan
> > 
> 
> Have you been through the provided perl documentation?  
> Surprisingly I found it incredibly helpful despite my lack of 
> its use for the first 4+ years of using Perl (granted I 
> already had the other standard issues, Camel, Cookbook, OOP 
> Perl, DBI, XML, etc.)  perldoc perl will give you a list of 
> goodies to try, once you understand using CPAN, then few 
> modules will have (or need) a book devoted to them (the 
> exceptions already do, CGI, DBI, XML) but most 90+% have good 
> standard documentation that is available with the module 
> itself or online. If you start with:

An excellent idea I second that motion! I got all caught up in books 
that I missed the place the books get their info! Thanks for the obvious!

Dan

> 
> perldoc perlmod  - Perl modules: how they work
> perldoc perlmodlib   - Perl modules: how to write and use
> perldoc perlmodinstallPerl modules: how to install from CPAN
> 
> perldoc perlreftut - Perl references short introduction
> perldoc perlref - Perl references, the rest of the story
> 
> That will give you a great overview and then exploring any 
> particular module should be relatively similar to any other.
> 
http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




OSX Aqua and Perl

2003-01-15 Thread Brian Ling
Hi all,

Does anyone know a way of creating GUI interfaces directly from Perl,
that will work with OS X's native Aqua interface?

Thanks for any info.

Brian




BBCi at http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain 
personal views which are not the views of the BBC unless specifically 
stated.
If you have received it in error, please delete it from your system, do 
not use, copy or disclose the information in any way nor act in 
reliance on it and notify the sender immediately. Please note that the 
BBC monitors e-mails sent or received. Further communication will 
signify your consent to this.




RE: Perl book

2003-01-15 Thread Dan Muey


> According to Amazon the Perl black book is out of print. :( 
That's a crime!
> you got me all hyped about checking it out :)
Sorry :) I get feverish on occasion about stuff. 
Maybe I should be in sales? N

> 
> > -Original Message-
> > From: Dan Muey [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 15, 2003 11:12 AM
> > To: Dylan Boudreau; [EMAIL PROTECTED]
> > Subject: RE: Perl book
> > 
> > 
> > 
> > I'd say go to the library then and check out some books
> > ( have them get them other libraries if they don't have them 
> > ) and when you find one you jive with go buy it.
> > 
> > I love 'The Black Book of Perl' and have learned most all
> > I do from it and I to do a lot of Unix Administration.
> > 
> > One reason I didn't jive real great with the O'reilly books
> > is that the ones I 
> > Had available to me where sort of vague while being 
> > desciptive at the same time Especially with modules. 
> > 
> > Example :
> > 
> > Page 114 of 'Perl in a Nutshell'
> > 
> > It is describing the pack function and does so quite well and
> > informative like. But if I'd never used pack before I'd have 
> > no idea what it is for. How am I supposed to understand what  
> > 'taking a list of values and packing it in a binary 
> > structure' is supposed to mean if I've never come across it before. 
> > 
> > There are no examples of situations you might use this or
> > samples of usage beside at the top
> > 
> > It has
> > Pack template, list
> > 
> > Then explains what pack does and what template and list are
> > but how do you know if you are supposed to do
> > 
> > pack($template, @list);
> > Or exactly like they have it
> > pack $template, $list;
> > Or both or can I do
> > Pack abBA, list
> > 
> > Or only one character where template is?
> > 
> > And I can see that for template I might use any number of
> > things a,A,b,B, etc and I can even see what they mean a - An 
> > ASCCI string, will be null padded.
> > 
> > That's a great reminder if you've used this before and
> > understand what 'An ASCCI string, will be null padded' means. 
> > What is list, an array or a string? What can it be, a file, 
> > input, what good would you get from using pack?
> > 
> > Why not thrown in :
> > You may want to use pack if you are .
> > 
> > And have at least one example
> > $value = "Example Of actual data you might want to use in
> > pack"; pack(a, $value);
> > 
> > This would return ... So that you could ...
> > 
> > So, to me, these books are much like Microsoft Tech Support :
> > There was a helicopter flying in Seattle and it became too 
> > foggy to see. Desperatley tring to find out where they were 
> > the pilot yelled out of the window to some people in  a 
> > building nearby ," We're lost! Where are we?" and the people 
> > said, "You're in a helicopter!". The helicopter landed safely 
> > and the crew asked how the pilot knew where to go based on 
> > what those people said and he replied, "Well, I knew we were 
> > by the Microsfot building because their answer was 
> > technically correct but completely useless. ".
> > 
> > So basically are the Orielly books I;ve seen good books. You
> > bet, they are informative and acurate but they are very 
> > difficult to learn new stuff from! 
> > So instead of learning something new it kind of makes you 
> > avoid learning new stuff because then you have to 
> > ask a list what this or that means and risk a pummeling at 
> > the ignorance you've shown!
> > 
> > I'd take one for free but I wouldn't pay for it.
> > 
> > But that's just me.
> > 
> > Dan
> > 
> > > I am a network administrator maintaining strictly Unix 
> boxes of some 
> > > type or another.  I want to become as proficient at Perl as I 
> > > possibly can because I see scripting as the week point on 
> my resume.  
> > > I have the Oreilly book "Perl for System Administrators" 
> but I want 
> > > to read another book before I get in to that one so I have a good 
> > > base.
> > > 
> > > I think the main thing I want to get out of the next book is more 
> > > familiarity with modules because Learning Perl doesn't 
> really cover 
> > > them well at all.
> > > 
> > > Dylan
> > > 
> > > -Original Message-
> > > From: Dan Muey [mailto:[EMAIL PROTECTED]]
> > > Sent: January 15, 2003 11:32 AM
> > > To: Dylan Boudreau; [EMAIL PROTECTED]
> > > Subject: RE: Perl book
> > > 
> > > 
> > > The black books are very nice. I like them better than 
> the Orielly 
> > > ones.
> > > 
> > > Not to start a flame war, I just like em better.
> > > 
> > > Also there's the 'using perl' for specifci jobs, system 
> admin, web 
> > > programming, database, algorythms, etc
> > > 
> > > Can't remember the publisher off hand, sorry.
> > > 
> > > Depends on what you want to use perl for now that you've done 
> > > Learning Perl.
> > > 
> > > You could do one of my favorite things and go into Barnes 
> and Noble 
> > > and read all of them, or check them out form the library 
> and start 
> > > it and 

RE: Perl book

2003-01-15 Thread Paul Kraus
According to Amazon the Perl black book is out of print. :( you got me
all hyped about checking it out :)

> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 11:12 AM
> To: Dylan Boudreau; [EMAIL PROTECTED]
> Subject: RE: Perl book
> 
> 
> 
> I'd say go to the library then and check out some books 
> ( have them get them other libraries if they don't have them 
> ) and when you find one you jive with go buy it.
> 
> I love 'The Black Book of Perl' and have learned most all 
> I do from it and I to do a lot of Unix Administration.
> 
> One reason I didn't jive real great with the O'reilly books 
> is that the ones I 
> Had available to me where sort of vague while being 
> desciptive at the same time Especially with modules. 
> 
> Example :
> 
> Page 114 of 'Perl in a Nutshell'
> 
> It is describing the pack function and does so quite well and 
> informative like. But if I'd never used pack before I'd have 
> no idea what it is for. How am I supposed to understand what  
> 'taking a list of values and packing it in a binary 
> structure' is supposed to mean if I've never come across it before. 
> 
> There are no examples of situations you might use this or 
> samples of usage beside at the top
> 
> It has
> Pack template, list
> 
> Then explains what pack does and what template and list are 
> but how do you know if you are supposed to do
> 
> pack($template, @list);
> Or exactly like they have it
> pack $template, $list;
> Or both or can I do 
> Pack abBA, list
> 
> Or only one character where template is?
> 
> And I can see that for template I might use any number of 
> things a,A,b,B, etc and I can even see what they mean a - An 
> ASCCI string, will be null padded.
> 
> That's a great reminder if you've used this before and 
> understand what 'An ASCCI string, will be null padded' means. 
> What is list, an array or a string? What can it be, a file, 
> input, what good would you get from using pack?
> 
> Why not thrown in : 
> You may want to use pack if you are .
> 
> And have at least one example
> $value = "Example Of actual data you might want to use in 
> pack"; pack(a, $value);
> 
> This would return ... So that you could ...
> 
> So, to me, these books are much like Microsoft Tech Support : 
> There was a helicopter flying in Seattle and it became too 
> foggy to see. Desperatley tring to find out where they were 
> the pilot yelled out of the window to some people in  a 
> building nearby ," We're lost! Where are we?" and the people 
> said, "You're in a helicopter!". The helicopter landed safely 
> and the crew asked how the pilot knew where to go based on 
> what those people said and he replied, "Well, I knew we were 
> by the Microsfot building because their answer was 
> technically correct but completely useless. ".
> 
> So basically are the Orielly books I;ve seen good books. You 
> bet, they are informative and acurate but they are very 
> difficult to learn new stuff from! 
> So instead of learning something new it kind of makes you 
> avoid learning new stuff because then you have to 
> ask a list what this or that means and risk a pummeling at 
> the ignorance you've shown!
> 
> I'd take one for free but I wouldn't pay for it. 
> 
> But that's just me.
> 
> Dan
> 
> > I am a network administrator maintaining strictly Unix boxes
> > of some type or another.  I want to become as proficient at 
> > Perl as I possibly can because I see scripting as the week 
> > point on my resume.  I have the Oreilly book "Perl for System 
> > Administrators" but I want to read another book before I get 
> > in to that one so I have a good base.
> > 
> > I think the main thing I want to get out of the next book is
> > more familiarity with modules because Learning Perl doesn't 
> > really cover them well at all.
> > 
> > Dylan
> > 
> > -Original Message-
> > From: Dan Muey [mailto:[EMAIL PROTECTED]]
> > Sent: January 15, 2003 11:32 AM
> > To: Dylan Boudreau; [EMAIL PROTECTED]
> > Subject: RE: Perl book
> > 
> > 
> > The black books are very nice. I like them better than the
> > Orielly ones.
> > 
> > Not to start a flame war, I just like em better.
> > 
> > Also there's the 'using perl' for specifci jobs, system
> > admin, web programming, database, algorythms, etc
> > 
> > Can't remember the publisher off hand, sorry.
> > 
> > Depends on what you want to use perl for now that you've done
> > Learning Perl.
> > 
> > You could do one of my favorite things and go into Barnes and
> > Noble and read all of them, or check them out form the 
> > library and start it and if you don't like it take it back 
> > and get another!!
> > 
> > Basically you can't go wrong with anything perl!!!
> > 
> > Dan
> > 
> > > -Original Message-
> > > From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, January 15, 2003 9:06 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Perl book
> > > 
> > > 
> > > I have already read Learning Perl 

RE: Perl book

2003-01-15 Thread wiggins


On Wed, 15 Jan 2003 11:39:04 -0400, "Dylan Boudreau" <[EMAIL PROTECTED]> wrote:

> I am a network administrator maintaining strictly Unix boxes of some
> type or another.  I want to become as proficient at Perl as I possibly
> can because I see scripting as the week point on my resume.  I have the
> Oreilly book "Perl for System Administrators" but I want to read another
> book before I get in to that one so I have a good base.
> 
> I think the main thing I want to get out of the next book is more
> familiarity with modules because Learning Perl doesn't really cover them
> well at all.
> 
> Dylan
> 

Have you been through the provided perl documentation?  Surprisingly I found it 
incredibly helpful despite my lack of its use for the first 4+ years of using Perl 
(granted I already had the other standard issues, Camel, Cookbook, OOP Perl, DBI, XML, 
etc.)  perldoc perl will give you a list of goodies to try, once you understand using 
CPAN, then few modules will have (or need) a book devoted to them (the exceptions 
already do, CGI, DBI, XML) but most 90+% have good standard documentation that is 
available with the module itself or online. If you start with:

perldoc perlmod  - Perl modules: how they work
perldoc perlmodlib   - Perl modules: how to write and use
perldoc perlmodinstallPerl modules: how to install from CPAN

perldoc perlreftut - Perl references short introduction
perldoc perlref - Perl references, the rest of the story

That will give you a great overview and then exploring any particular module should be 
relatively similar to any other.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Dan Muey

I'd say go to the library then and check out some books 
( have them get them other libraries if they don't have them )
and when you find one you jive with go buy it.

I love 'The Black Book of Perl' and have learned most all 
I do from it and I to do a lot of Unix Administration.

One reason I didn't jive real great with the O'reilly books is that the ones I 
Had available to me where sort of vague while being desciptive at the same time
Especially with modules. 

Example :

Page 114 of 'Perl in a Nutshell'

It is describing the pack function and does so quite well and informative like.
But if I'd never used pack before I'd have no idea what it is for.
How am I supposed to understand what  'taking a list of values and packing it in a 
binary structure' is supposed to mean if I've never come across it before. 

There are no examples of situations you might use this or samples of usage beside at 
the top

It has
Pack template, list

Then explains what pack does and what template and list are but how do you know if you 
are supposed to do

pack($template, @list);
Or exactly like they have it
pack $template, $list;
Or both or can I do 
Pack abBA, list

Or only one character where template is?

And I can see that for template I might use any number of things a,A,b,B, etc and I 
can even see what they mean
a - An ASCCI string, will be null padded.

That's a great reminder if you've used this before and understand what 'An ASCCI 
string, will be null padded'
means.
What is list, an array or a string? What can it be, a file, input, what good would you 
get from using pack?

Why not thrown in : 
You may want to use pack if you are .

And have at least one example
$value = "Example Of actual data you might want to use in pack";
pack(a, $value);

This would return ... So that you could ...

So, to me, these books are much like Microsoft Tech Support :
There was a helicopter flying in Seattle and it became too foggy to see. Desperatley 
tring to find out where they were the pilot yelled out of the window to some people in 
 a building nearby ," We're lost! Where are we?" and the people said, "You're in a 
helicopter!". The helicopter landed safely and the crew asked how the pilot knew where 
to go based on what those people said and he replied, "Well, I knew we were by the 
Microsfot building because their answer was technically correct but completely 
useless. ".

So basically are the Orielly books I;ve seen good books. You bet, they are informative 
and acurate but they are very difficult to learn new stuff from! 
So instead of learning something new it kind of makes you avoid learning new stuff 
because then you have to 
ask a list what this or that means and risk a pummeling at the ignorance you've shown!

I'd take one for free but I wouldn't pay for it. 

But that's just me.

Dan

> I am a network administrator maintaining strictly Unix boxes 
> of some type or another.  I want to become as proficient at 
> Perl as I possibly can because I see scripting as the week 
> point on my resume.  I have the Oreilly book "Perl for System 
> Administrators" but I want to read another book before I get 
> in to that one so I have a good base.
> 
> I think the main thing I want to get out of the next book is 
> more familiarity with modules because Learning Perl doesn't 
> really cover them well at all.
> 
> Dylan
> 
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]] 
> Sent: January 15, 2003 11:32 AM
> To: Dylan Boudreau; [EMAIL PROTECTED]
> Subject: RE: Perl book
> 
> 
> The black books are very nice. I like them better than the 
> Orielly ones.
> 
> Not to start a flame war, I just like em better.
> 
> Also there's the 'using perl' for specifci jobs, system 
> admin, web programming, database, algorythms, etc
> 
> Can't remember the publisher off hand, sorry. 
> 
> Depends on what you want to use perl for now that you've done 
> Learning Perl.
> 
> You could do one of my favorite things and go into Barnes and 
> Noble and read all of them, or check them out form the 
> library and start it and if you don't like it take it back 
> and get another!!
> 
> Basically you can't go wrong with anything perl!!!
> 
> Dan
> 
> > -Original Message-
> > From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 15, 2003 9:06 AM
> > To: [EMAIL PROTECTED]
> > Subject: Perl book
> > 
> > 
> > I have already read Learning Perl and am looking to get 
> another book 
> > to learn more what would people recommend?
> >  
> > Thanks,
> >  
> > Dylan
> >  
> > 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: pipe in perl ???

2003-01-15 Thread Martin A. Hansen
On Wed, Jan 15, 2003 at 10:33:45AM -0500, Bob Showalter wrote:
> Bob Showalter wrote:
> > [EMAIL PROTECTED] wrote:
> > > i need to translate the following commandline to perl:
> > > 
> > > (echo "set term post"; echo "plot '-' w l"; cat data) | gnuplot >
> > > data.ps
> > 
> >open(F, "| gnuplot >data.ps") or die $!;
> >print F "set term post\n", "plot '-' w l\n";
> >print "$_\n" for @commands;
> 
> Oops, forgot the filehandle. That should be
> 
>  print F "$_\n" for @commands;
> 

perfect! i got the same syntax working just before reading this :)))

thanx

martin


> >close F or die $!;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl book

2003-01-15 Thread Jostein Berntsen
Hi,

I think this book is very good with many useful examples:

http://www.manning.com/cross/

and this is a good one too:

http://vig.prenhall.com/catalog/academic/product/1,4096,0130282510,00.html

Read, code and enjoy!

Jostein

> I have already read Learning Perl and am looking to get another book to
> learn more what would people recommend?
>  
> Thanks,
>  
> Dylan
>  



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Beau E. Cox
Hey Reggie - why are your messages getting posted 2,3,or 4 times?

> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 5:26 AM
> To: Dan Muey; Beau E. Cox; Johnson, Reginald (ECCS); [EMAIL PROTECTED]
> Subject: RE: printing number with commas in it
> 
> 
> 
> 
> > -Original Message-
> > From: Dan Muey 
> > Sent: Wednesday, January 15, 2003 9:19 AM
> > To: Beau E. Cox; Johnson, Reginald (ECCS); [EMAIL PROTECTED]
> > Subject: RE: printing number with commas in it
> > 
> > 
> > > Hi Reggie!
> > > 
> > > > -Original Message-
> > > > From: Johnson, Reginald (ECCS) [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, January 14, 2003 11:32 AM
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: printing number with commas in it
> > > > 
> > > > 
> > > > I am trying to print a number with commas in it. I cannot 
> > find the 
> > > > correct syntax to do this with printf. I considered using 
> > the substr 
> > > > function but this depends on mealways knowing the size of the 
> > > > number. Can you help me with this?
> > > > 
> > > > 
> > > > Reggie
> > > > 
> > > 
> > > From the Perl Cookbook (2.17):
> > > 
> > > sub commify
> > > {
> > >   my $text = reverse $_[0];
> > >   $text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
> > >   scalar reverse $text;
> > This last bit didn't reverse it back so I tried
> > $text = reverse $text;
> > And that turned it back around but the regex added no 
> > commas!! Any body have any ideas on this one? I tried :
> > 
> > $num = '123456';
> > &commify("$num");
> > 
> > sub commify
> > {
> >my $text = reverse $_[0];
> >$text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
> >print "\n$text \n ";
> >$text = reverse $text;
> >print "\n$text\n";
> > }
> > And got : ( $_[0] was 123456 )
> > 
> > 123456
> > 
> > 654321 
> >  
> > 123456
> > 
> > See no commas! What to do for regex ?
> 
> It was :
> $text =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
> Mentioned in another post
> 
> > > }
> > > 
> > > Baring my typos, this works on a numeric string
> > > even with a decimal point.
> > > 
> > > Aloha => Beau;
> > > 
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Dylan Boudreau
I am a network administrator maintaining strictly Unix boxes of some
type or another.  I want to become as proficient at Perl as I possibly
can because I see scripting as the week point on my resume.  I have the
Oreilly book "Perl for System Administrators" but I want to read another
book before I get in to that one so I have a good base.

I think the main thing I want to get out of the next book is more
familiarity with modules because Learning Perl doesn't really cover them
well at all.

Dylan

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 11:32 AM
To: Dylan Boudreau; [EMAIL PROTECTED]
Subject: RE: Perl book


The black books are very nice. I like them better than the Orielly ones.

Not to start a flame war, I just like em better.

Also there's the 'using perl' for specifci jobs, system admin, web
programming, database, algorythms, etc

Can't remember the publisher off hand, sorry. 

Depends on what you want to use perl for now that you've done Learning
Perl.

You could do one of my favorite things and go into Barnes and Noble and
read all of them, or check them out form the library and start it and if
you don't like it take it back and get another!!

Basically you can't go wrong with anything perl!!!

Dan

> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 9:06 AM
> To: [EMAIL PROTECTED]
> Subject: Perl book
> 
> 
> I have already read Learning Perl and am looking to get
> another book to learn more what would people recommend?
>  
> Thanks,
>  
> Dylan
>  
> 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl book

2003-01-15 Thread Ben Siders
My Perl libary consists of Learning Perl, Programming Perl, The Perl 
Cookbook, Advanced Perl Programming, and I just ordered the DBI book. 
Most people probably don't need all those, and I probably wouldn't have 
them all if I hadn't received most of them during some professional 
training classes.  There's a lot of material replication among those. 
All, the same, they're all great tomes and if you have the means, I 
recommend them all.

Paul Kraus wrote:

Programming Perl by Oreilly

 

-Original Message-
From: Dylan Boudreau [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 15, 2003 10:06 AM
To: [EMAIL PROTECTED]
Subject: Perl book


I have already read Learning Perl and am looking to get 
another book to learn more what would people recommend?

Thanks,

Dylan


   



 




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Dan Muey
The black books are very nice. I like them better than the Orielly ones. 
Not to start a flame war, I just like em better.

Also there's the 'using perl' for specifci jobs, system admin, web programming, 
database, algorythms, etc

Can't remember the publisher off hand, sorry. 

Depends on what you want to use perl for now that you've done Learning Perl.

You could do one of my favorite things and go into Barnes and Noble and read all of 
them, or check them out form the library and start it and if you don't like it take it 
back and get another!!

Basically you can't go wrong with anything perl!!!

Dan

> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 9:06 AM
> To: [EMAIL PROTECTED]
> Subject: Perl book
> 
> 
> I have already read Learning Perl and am looking to get 
> another book to learn more what would people recommend?
>  
> Thanks,
>  
> Dylan
>  
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: pipe in perl ???

2003-01-15 Thread Bob Showalter
Bob Showalter wrote:
> [EMAIL PROTECTED] wrote:
> > i need to translate the following commandline to perl:
> > 
> > (echo "set term post"; echo "plot '-' w l"; cat data) | gnuplot >
> > data.ps
> 
>open(F, "| gnuplot >data.ps") or die $!;
>print F "set term post\n", "plot '-' w l\n";
>print "$_\n" for @commands;

Oops, forgot the filehandle. That should be

 print F "$_\n" for @commands;

>close F or die $!;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: pipe in perl ???

2003-01-15 Thread Bob Showalter
[EMAIL PROTECTED] wrote:
> i need to translate the following commandline to perl:
> 
> (echo "set term post"; echo "plot '-' w l"; cat data) | gnuplot >
> data.ps 

   open(F, "| gnuplot >data.ps") or die $!;
   print F "set term post\n", "plot '-' w l\n";
   print "$_\n" for @commands;
   close F or die $!;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Beau E. Cox
HI -

> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 5:06 AM
> To: [EMAIL PROTECTED]
> Subject: Perl book
> 
> 
> I have already read Learning Perl and am looking to get another book to
> learn more what would people recommend?
>  
> Thanks,
>  
> Dylan
>  

The Camel book Programming Perl (O"Reilly)

Aloha => Beau;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl book

2003-01-15 Thread Paul Kraus
Programming Perl by Oreilly

> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 10:06 AM
> To: [EMAIL PROTECTED]
> Subject: Perl book
> 
> 
> I have already read Learning Perl and am looking to get 
> another book to learn more what would people recommend?
>  
> Thanks,
>  
> Dylan
>  
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Dan Muey


> -Original Message-
> From: Dan Muey 
> Sent: Wednesday, January 15, 2003 9:19 AM
> To: Beau E. Cox; Johnson, Reginald (ECCS); [EMAIL PROTECTED]
> Subject: RE: printing number with commas in it
> 
> 
> > Hi Reggie!
> > 
> > > -Original Message-
> > > From: Johnson, Reginald (ECCS) [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, January 14, 2003 11:32 AM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: printing number with commas in it
> > > 
> > > 
> > > I am trying to print a number with commas in it. I cannot 
> find the 
> > > correct syntax to do this with printf. I considered using 
> the substr 
> > > function but this depends on mealways knowing the size of the 
> > > number. Can you help me with this?
> > > 
> > > 
> > > Reggie
> > > 
> > 
> > From the Perl Cookbook (2.17):
> > 
> > sub commify
> > {
> >   my $text = reverse $_[0];
> >   $text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
> >   scalar reverse $text;
> This last bit didn't reverse it back so I tried
> $text = reverse $text;
> And that turned it back around but the regex added no 
> commas!! Any body have any ideas on this one? I tried :
> 
> $num = '123456';
> &commify("$num");
> 
> sub commify
> {
>my $text = reverse $_[0];
>$text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
>print "\n$text \n ";
>$text = reverse $text;
>print "\n$text\n";
> }
> And got : ( $_[0] was 123456 )
> 
> 123456
> 
> 654321 
>  
> 123456
> 
> See no commas! What to do for regex ?

It was :
$text =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
Mentioned in another post

> > }
> > 
> > Baring my typos, this works on a numeric string
> > even with a decimal point.
> > 
> > Aloha => Beau;
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Dan Muey
Disregard my last post! That was the regex of the 
day to replace the one in that commati routine.
Works like a charm.

Dan

> -Original Message-
> From: Westgate, Jared [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 9:18 AM
> To: Johnson, Reginald (ECCS)
> Cc: [EMAIL PROTECTED]
> Subject: RE: printing number with commas in it
> 
> 
> Reggie Wrote:
> > 
> > I am trying to print a number with commas in it. I cannot
> > find the correct syntax to do this with printf.
> > I considered using the substr function but this depends on 
> > mealways knowing the size of the number.
> > Can you help me with this?
> 
> I like to use the method listed in the perldocs.  Try this:
> 
>   perldoc -q "output my numbers with commas"
> 
> It lists a really cool solution, although I'm sure there are 
> plenty of others :) It credits Benjamin Goldberg with this:
> 
>s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
> 
> Hope this will work for you,
> 
> Jared
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Dan Muey
> Hi Reggie!
> 
> > -Original Message-
> > From: Johnson, Reginald (ECCS) [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 14, 2003 11:32 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: printing number with commas in it
> > 
> > 
> > I am trying to print a number with commas in it. I cannot find
> > the correct syntax to do this with printf.
> > I considered using the substr function but this depends on 
> > mealways knowing the size of the number.
> > Can you help me with this?
> > 
> > 
> > Reggie
> > 
> 
> From the Perl Cookbook (2.17):
> 
> sub commify
> {
>   my $text = reverse $_[0];
>   $text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
>   scalar reverse $text;
This last bit didn't reverse it back so I tried
$text = reverse $text;
And that turned it back around but the regex added no commas!!
Any body have any ideas on this one?
I tried :

$num = '123456';
&commify("$num");

sub commify
{
   my $text = reverse $_[0];
   $text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
   print "\n$text \n ";
   $text = reverse $text;
   print "\n$text\n";
}
And got : ( $_[0] was 123456 )

123456

654321 
 
123456

See no commas! What to do for regex ?
> }
> 
> Baring my typos, this works on a numeric string
> even with a decimal point.
> 
> Aloha => Beau;
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Westgate, Jared
Reggie Wrote:
> 
> I am trying to print a number with commas in it. I cannot 
> find the correct syntax to do this with printf.
> I considered using the substr function but this depends on 
> mealways knowing the size of the number.
> Can you help me with this?

I like to use the method listed in the perldocs.  Try this:

  perldoc -q "output my numbers with commas"

It lists a really cool solution, although I'm sure there are plenty of others :)
It credits Benjamin Goldberg with this:

   s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;

Hope this will work for you,

Jared

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl book

2003-01-15 Thread Dylan Boudreau
I have already read Learning Perl and am looking to get another book to
learn more what would people recommend?
 
Thanks,
 
Dylan
 



RE: perl confusion/ and passwd

2003-01-15 Thread Dan Muey
You may want to try using some unix functions to do this.

If you're really good at verifying that their input is legal, that the user exists, 
that their old password is right and that the new ones match and you're 100% sure oyu 
want to do this you could always do backtick execution.

man pw
man htpasswd

Of course all of that depends if you have permision to modify that stuff as in who 
your script is running as, setuid or apache's user or ???.
Is it a system user account, qmail, or ???

You may be best to talk to the administrator of that box to find the best and most 
secure way for you to do that since he or she would know all about the permissions and 
all of the doo dah's the machine has.

Dan



> -Original Message-
> From: Edmund [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 8:28 AM
> To: Perl
> Subject: perl confusion/ and passwd
> 
> 
> Hi,
> 
> I need some help getting cleared up with an issue I had this 
> afternoon (and still trying to figure out now).  I have Perl 
> 5.6.1 installed at work.  It didn't come (AFAIK) with 
> NDBM_FILE.pm.  (Required for chpass... which brings me to a 
> different question that I'll ask after this).  So I go to 
> CPAN and check the DATABASE INTERFACES section. I find 
> NDBM_FILE.  I go there and find tarballs of perl5.6.0, 5.6.1 
> and 5.8.0. as well as subfolders of two authors.  
> 
> If I may, I'd like to ask some questions :
> 
> 1) Pardon my ignorance, but is NDBM_FILE.pm now included
> with the Perl tarballs?  If so, I just need to d/l
> the latest (I'm assuming 5.8.0) and install it?  
> 
> 2) Since 5.6.1 is installed right now, can I install
> 5.8.0 over it without uninstalling 5.6.1? (Btw,
> I'm running Slackware Linux 8.0). 
> 
> With regards to chpass, I'm trying to create a
> web-based page so that local intranet users
> can use that to change their email password.  
> Security wise, is this a good idea?  The
> page itself is only accessible via a few
> specific local IPs.  Is there a module out
> there that can help me in this regard?  
> 
> I've only gotten to the point of grabbing the
> user's username, old password and new password
> from a form. I can parse the information easily.  
> It's after parsing that I"m unsure as how to
> go about in changing the user's password.  Since
> I'm running the website under a non-root user,
> changing some other user's password isn't easy.
> I d/led this tarball (that included the html
> files to change the password .. wwwpass.??.tar.gz)
> but since I don't have NDBM_FILE installed I
> couldn't run it.  
> 
> Any help very much appreciated.
> 
> Edmund
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: determining variable types

2003-01-15 Thread Beau E. Cox
Hi -

> -Original Message-
> From: OROSZI Balázs [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 11:56 AM
> To: [EMAIL PROTECTED]
> Subject: determining variable types
>
>
> Hello!
>
> Is it possible to get the type of a variable at run time?
> Suppose I have $var which may be a ref to a hash, or a ref to an
> array or a
> scalar (maybe a ref to it).
>
> Should I try to hack it out from the address
> (the weird thing, for example ARRAY(0x...))?
> Or is there any other way?
>
> Please, answer as soon as you can. I need to know this in short time.
> Thank you.
>
> --
> Greetings,
>  Balázs
>
> P.S.: Sorry, if I sent it twice
>

Yes.

Use the perl build in function 'ref':

  if(ref $variable eq 'HASH') { ... }

you can use "HASH', 'ARRAY', 'SCALAR' (and other, less common ones).

 if (not ref $variable) { ... means it's not a reference ... }

Refer to the Camel book or perlfunc doc for more details.

Aloha => Beau;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: CSV File Creation

2003-01-15 Thread zentara
On Wed, 15 Jan 2003 08:46:04 +1100, [EMAIL PROTECTED]
(Colin Johnstone) wrote:

>Is a CSV a comma delimited list. If so when creating a CSV how does one cope with 
>fields that have commas in them. 
>
>An address filed for example could be written suite 2, lvl 3.
>
>Do you write the field names out with quotes around them?

Flak-jacket on!

A simple way around this is to use something like chr(1) for your
separator, instead of a comma. Then your only problem is to
filter all fields to exclude chr(1). chr(1) is non-printable, so when
you look at your csv files, you will see a funny symbol in place of
it. On my system, it's a diamond.

Just run all new data thru this regex:
$fielddata =~ s/chr(1)//g;
and that prevents a hacker from messing up your data.

I've been chastised before for mentioning this, because it is 
"non-standard"; but it works for me, and is simple.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: printing number with commas in it

2003-01-15 Thread Beau E. Cox
Hi Reggie!

> -Original Message-
> From: Johnson, Reginald (ECCS) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 11:32 AM
> To: '[EMAIL PROTECTED]'
> Subject: printing number with commas in it
> 
> 
> I am trying to print a number with commas in it. I cannot find 
> the correct syntax to do this with printf.
> I considered using the substr function but this depends on 
> mealways knowing the size of the number.
> Can you help me with this?
> 
> 
> Reggie
> 

>From the Perl Cookbook (2.17):

sub commify
{
  my $text = reverse $_[0];
  $text =~ s/(\d\d\d)(?=\d)(?!\d*.)/$1,/g;
  scalar reverse $text;
}

Baring my typos, this works on a numeric string
even with a decimal point.

Aloha => Beau;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: determining variable types

2003-01-15 Thread Dan Muey
Do you realize you've posted this message three times so far today and I think 
yesterday as well?
Check your mail prog.

> -Original Message-
> From: OROSZI Balázs [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, January 14, 2003 3:56 PM
> To: [EMAIL PROTECTED]
> Subject: determining variable types
> 
> 
> Hello!
> 
> Is it possible to get the type of a variable at run time? 
> Suppose I have $var which may be a ref to a hash, or a ref to 
> an array or a scalar (maybe a ref to it).
> 
> Should I try to hack it out from the address
> (the weird thing, for example ARRAY(0x...))?
> Or is there any other way?
> 
> Please, answer as soon as you can. I need to know this in 
> short time. Thank you.
> 
> --
> Greetings,
>  Balázs
> 
> P.S.: Sorry, if I sent it twice
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Random Number Generation

2003-01-15 Thread Dylan Boudreau
int(rand 25000)

Dylan

-Original Message-
From: Maurice O'Prey [mailto:[EMAIL PROTECTED]] 
Sent: January 15, 2003 10:28 AM
To: [EMAIL PROTECTED]
Subject: Random Number Generation


Hi All

How do I extract a whole number from the rand function.

I am using rand 25000; which generates a random number with many decimal
places, e.g. 16235.2587965, I need a whole number as the answer. Sorry
if this is simple...

Regards

Maurice



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




perl confusion/ and passwd

2003-01-15 Thread Edmund
Hi,

I need some help getting cleared up with an issue I had this
afternoon (and still trying to figure out now).  I have
Perl 5.6.1 installed at work.  It didn't come (AFAIK) with
NDBM_FILE.pm.  (Required for chpass... which brings me
to a different question that I'll ask after this).  So
I go to CPAN and check the DATABASE INTERFACES section.
I find NDBM_FILE.  I go there and find tarballs of
perl5.6.0, 5.6.1 and 5.8.0. as well as subfolders of
two authors.  

If I may, I'd like to ask some questions :

1) Pardon my ignorance, but is NDBM_FILE.pm now included
with the Perl tarballs?  If so, I just need to d/l
the latest (I'm assuming 5.8.0) and install it?  

2) Since 5.6.1 is installed right now, can I install
5.8.0 over it without uninstalling 5.6.1? (Btw,
I'm running Slackware Linux 8.0). 

With regards to chpass, I'm trying to create a
web-based page so that local intranet users
can use that to change their email password.  
Security wise, is this a good idea?  The
page itself is only accessible via a few
specific local IPs.  Is there a module out
there that can help me in this regard?  

I've only gotten to the point of grabbing the
user's username, old password and new password
from a form. I can parse the information easily.  
It's after parsing that I"m unsure as how to
go about in changing the user's password.  Since
I'm running the website under a non-root user,
changing some other user's password isn't easy.
I d/led this tarball (that included the html
files to change the password .. wwwpass.??.tar.gz)
but since I don't have NDBM_FILE installed I
couldn't run it.  

Any help very much appreciated.

Edmund

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: pipe in perl ???

2003-01-15 Thread Martin A. Hansen
On Wed, Jan 15, 2003 at 08:27:13AM -0600, [EMAIL PROTECTED] wrote:
> Sorry if I already missed a post where you said you couldn't (have had the flu), but 
>could you use one of the various modules in CPAN to control gnuplot instead of trying 
>to manipulate it yourself?
> 

hi

i did look at it, but i found it confusing. anyhows, i need to learn perl and
redirecting output is good to know.


martin


> A quick search:
> http://search.cpan.org/search?query=Gnuplot&mode=all
> http://search.cpan.org/author/CAIDAPERL/Chart-Graph-2.0/Graph/Gnuplot.pm
> http://search.cpan.org/author/ILYAZ/Term-Gnuplot-0.5704/Gnuplot.pm
> 
> Just a thought.
> 
> http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Time Clock Idea

2003-01-15 Thread Paul Kraus
I am thinking about designing a new time clock system for my work. I was
looking at the digital persona u.are.u devices. Has anyone written any
code to work with these for authentication? Is it even possible.

It would be nice to just through up a couple sensors. An employee comes
in. Sticks his finger down they are clocked in.

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ppm: No suitable installation target for package G

2003-01-15 Thread David Eason
Thanks! Now I have another problem.

Is there a ppm repository for File-DosGlob or do I need to figure out how to
get the cpan shell working in Windows?

"Jenda Krynicky" <[EMAIL PROTECTED]> wrote in message
3E21CB2D.30323.C586393@localhost">news:3E21CB2D.30323.C586393@localhost...
> From: "David Eason" <[EMAIL PROTECTED]>
> > What does the error "No suitable installation target for package ..."
> > mean? I am using ppm 3.0.1 from perl 5.8.0 build 802.
>
> It means that PPM did not find the right version of the module for
> your version of Perl.
>
> > ppm> describe G
>
> Sorry I forgot to upload the 5.8 version.
> This should work now.
>
> Jenda
> = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Random Number Generation

2003-01-15 Thread Ed Christian
> -Original Message-
> From: Maurice O'Prey [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 15, 2003 9:28 AM
> Hi All
> 
> How do I extract a whole number from the rand function.
> 
> I am using rand 25000; which generates a random number with 
> many decimal
> places, e.g. 16235.2587965, I need a whole number as the 
> answer. Sorry if
> this is simple...
> 

int (rand 25000);

> Regards
> 
> Maurice
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




determining variable types

2003-01-15 Thread OROSZI Balázs
Hello!

Is it possible to get the type of a variable at run time?
Suppose I have $var which may be a ref to a hash, or a ref to an array or a
scalar (maybe a ref to it).

Should I try to hack it out from the address
(the weird thing, for example ARRAY(0x...))?
Or is there any other way?

Please, answer as soon as you can. I need to know this in short time.
Thank you.

--
Greetings,
Balázs

P.S.: Sorry, if I sent it twice


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  1   2   >