RE: [Perl-unix-users] sorting hash values

2004-07-29 Thread Einecker, Leah
One way is to make a custom sorting function. You pass it a list of items and it goes through the list and compares each via the variables $a and $b. You make the function return -1 if $a is "smaller than" or "before" $b, 1 if $a is "bigger than" or "after" $b, or 0 if they are tied. In this case

RE: [Perl-unix-users] flush matched $digit vars

2004-05-18 Thread Einecker, Leah
If you want to put nothing in a known number of $digit variables, you can match nothing to overwrite them with the nothing you matched: "" =~ /()()()/; Cheers, -L >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of >[EMAIL PROTECTED] >Sent: Tuesday, May 18,

RE: [Perl-unix-users] Problem writing to file

2003-02-18 Thread Einecker, Leah
You can find out the reason OUT is not opening as you expect by replacing this: open(OUT,">$outFile"); with this: open(OUT,">$outFile") or die "Cannot open OUT: $!"; >-Original Message- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, February 18, 2003 3:20 PM >To: Pe

RE: [Perl-unix-users] replace "~" with \n

2002-10-04 Thread Einecker, Leah
Oops, the fingers don't type so well this early in the morning... I meant \n, not \\n. >-Original Message- >From: Einecker, Leah [mailto:[EMAIL PROTECTED]] >Sent: Friday, October 04, 2002 9:14 AM >To: 'Terry Vaughn'; [EMAIL PROTECTED] >Subject: RE: [Per

RE: [Perl-unix-users] replace "~" with \n

2002-10-04 Thread Einecker, Leah
perl -e 'open IN, "){s/\~/\\n/g;print;}' > Newfile.txt >-Original Message- >From: Terry Vaughn [mailto:[EMAIL PROTECTED]] >Sent: Friday, October 04, 2002 8:59 AM >To: [EMAIL PROTECTED] >Subject: [Perl-unix-users] replace "~" with \n > > >Hello. > >Can anyone tell me a quick way to replace

RE: [Perl-unix-users] Remove blank lines from a file

2002-08-15 Thread Einecker, Leah
You could use something like this: open MYFILE, "<$filename" or die "can't open the file: $!"; foreach $one_line () { push (@lines, $one_line) if $one_line =~ /\S/; } close MYFILE; # now only the non-blank lines are in @lines Cheers, -L -Original Message- From: Craig Sharp [mail

RE: [Perl-unix-users] FTP to AS400, issue sending command

2002-08-13 Thread Einecker, Leah
Hi! Have you tried using $ftp->site()? "site (ARGS) Send a SITE command to the remote server and wait for a response. Returns most significant digit of the response code." (Net::FTP perldoc) If that doesn't work, you may be able to get it working as $ftp->quot(): "quot (CMD [,ARGS]) Send