Arrays as subroutines arguments

2001-07-26 Thread Diego Riaño
Hi How can I pass two arrays as subroutine arguments? thanks in advances -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

array contents to a file

2001-07-26 Thread Ron Smith
Could someone provide a snippet of code that reads the contents of an array to a text file. Thanks, Ron _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

RE: array contents to a file

2001-07-26 Thread John Edwards
Like this?? @array = qw(one two three four); open FILE, ">c:\\out.txt" or die "Can't create c:\\out.txt: $!"; foreach $element(@array) { print FILE "$element\n"; } close FILE; -Original Message- From: Ron Smith [mailto:[EMAIL PROTECTED]] Sent: 26 July 2001 09:36 To: [EMAIL PROTE

Re: Arrays as subroutines arguments

2001-07-26 Thread Maxim Berlin
Hello Diego, Thursday, July 26, 2001, Diego Riaño <[EMAIL PROTECTED]> wrote: DR> How can I pass two arrays as subroutine arguments? passing arrays as arguments is bad idea; you should use references. my_sub(\@array1, \@array2); sub my_sub { my ($ref1,$ref2) = @_; print $$ref1[0], $$ref2[0]; }

Re: Reading binary files

2001-07-26 Thread Maxim Berlin
Hello Sambamoorthy, Thursday, July 26, 2001, Sambamoorthy Jayaraman <[EMAIL PROTECTED]> wrote: SJ> How do I read a binary file?? From this file, I need to read 16 bit values. SJ> I have attached a sample binary file alongwith. When you are reading this SJ> file, enable `hex edit mode'. perldoc

table problem

2001-07-26 Thread GRANATA ROBERTA
--- Erhalten von ZBM.ZAGTA 089/32000-414 26-07-01 11.40 Hi all, i have problem with tag in the table. i have a program and a want to chance with use CGI; i try to use : print $q->start_table(); print $q->end_table; and $q = new CGI; ex. print $q->table({-border => "0", -al

file's manipulation

2001-07-26 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I ask two questions: 1) how can i do to add a line in the begining of a file ? 2) how can i do to delete lines after a character string which is in a line ? thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Convert date mmddyy to day of the week

2001-07-26 Thread Tim Noll
Try the Date::Calc module. It has tons of handy date functions. Example: use Date::Calc qw(Decode_Date_US Day_of_Week Day_of_Week_to_Text); my $text = '07/25/01'; #if validity of date is in question my @date = Decode_Date_US($text); print ((@date ? Day_of_Week_to_Text(Day_of_Week(@date)) : "not

isWindows95() and isWIndowsNT()

2001-07-26 Thread Barry Carroll
Hi all, This is my first post :) I once saw functions such as the ones above for perl. I am writing a script and I want to be able to determine the machine's Operating System type. Does anyone know where i can get these functions or similar ones to determine the OS type. I know how to get the

RE: Convert date mmddyy to day of the week

2001-07-26 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 4:33 PM > To: [EMAIL PROTECTED] > Subject: Convert date mmddyy to day of the week > > > I want to convert a date in the format mm/dd/yy to the day of > the week. For example 07/2

Re: isWindows95() and isWIndowsNT()

2001-07-26 Thread Pierre Smolarek
$ENV{OS} will get you the os on some platforms,. run this simple script on your systems and check it out.. foreach (keys(%ENV)){ print "\$ENV{$_} $ENV{$_} \n"; } pierre - Original Message - From: "Barry Carroll" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 26, 200

Re: file's manipulation

2001-07-26 Thread Jerry Preston
COLLINEAU, You need to open a new file, then the one in question. 1. Add the new line to the new file. 2. Read from the old file and write to the new file. 3. If need to alter any line or delete it, then do not write it to your new file 4. Close your files. Jerry COLLINEAU Franck FTRD/

Re:height & width Perl Tk

2001-07-26 Thread Jorge Goncalvez
Hi, I made some buttons with bitmap : my $bouton=$mw->Button(-bitmap => 'error', -relief =>'raised', -height =>'27', -width => '27', -cursor => 'pirate',

RE: USPS has me stumped!

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Luke Bakken [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 5:13 PM > To: [EMAIL PROTECTED] > Subject: USPS has me stumped! > > > Hi all, > > I'm tinkering with some of the libwww modules and trying to > get some information from the USPS web s

SENDMAIL

2001-07-26 Thread Mohammed Maraikayar
anyone has an idea how to send email by sendmail in linux 7.1 thanks, mohamed __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

RE: clearing memory

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Michael Fowler [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 5:26 PM > To: Yacketta, Ronald > Cc: Beginners (E-mail) > Subject: Re: clearing memory > > ... > The ideal solution would be to use > lexical variables that go out of scope before it s

RE: SENDMAIL

2001-07-26 Thread Neil Fryer
Use 'mail [EMAIL PROTECTED] -s Subject:whatever' cheers Neil Fryer Solaris Systems Administrator [EMAIL PROTECTED] -Original Message- From: Mohammed Maraikayar [mailto:[EMAIL PROTECTED]] Sent: 26 July 2001 02:48 To: [EMAIL PROTECTED] Subject: SENDMAIL anyone has an idea how to send e

RE: Tear me to shreds please...

2001-07-26 Thread Smith, Jim R
First, this is a beginners list, so there will be no tearing to shreds. Secondly: The Great Truth of Perl: "There is always more than one way to do it" . suggestion: replace this:$j = scalar(@array); $j--; for $d (0 .. $j) with this:

Beginners OO tutorial

2001-07-26 Thread Jos I. Boumans
LS, as promised, i wrote up a beginners OO tutorial i split it into mulitple parts as i saw the tutorial growing to quite a size part 1 is now up and can be read in the tutorials section of http://japh.nu part 2 and followign will be up there shortly (and for those wondering, yes, i put the nu

RE: Reading binary files

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Sambamoorthy Jayaraman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 2:32 AM > To: [EMAIL PROTECTED] > Subject: Reading binary files > > > Hi, > > How do I read a binary file?? From this file, I need to read > 16 bit values. > I have attached

RE: array contents to a file

2001-07-26 Thread Bob Showalter
> -Original Message- > From: John Edwards [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 4:43 AM > To: 'Ron Smith'; [EMAIL PROTECTED] > Subject: RE: array contents to a file > > ... > foreach $element(@array) { > print FILE "$element\n"; > } FWIW, this can be simplifed

RE: isWindows95() and isWIndowsNT()

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Barry Carroll [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 8:18 AM > To: '[EMAIL PROTECTED]' > Subject: isWindows95() and isWIndowsNT() > > > Hi all, > > This is my first post :) > > I once saw functions such as the ones above for perl. > >

RE: Tear me to shreds please...

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Michael Carmody [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 2:30 AM > To: [EMAIL PROTECTED] > Subject: Tear me to shreds please... > ... Regarding this section of the code: > $c = ($data[4][$i] =~ s/\//\//g); > if ($c eq "")

Another pattern question

2001-07-26 Thread Daniel Mester
Hi again, for example i have a file like : zxcvzxcv qwerasdf bnmmsdfgy I need to split the sentences into a variables in list. So i do it in 2 stages: 1. Remove the \t form each pair: foreach (@list) { push(@temp, (split(/\t+/, $_))); } 2. Then i remove the \n between the strings: f

Login error w/FTP

2001-07-26 Thread Sparkle Williams
Well, I have this script that I'm trying to write using the FTP module, however it keeps responding with an error message concerning the login line of the script whenever I try to run it. I have run out of ideas and have absolutely no clue as to what the problem is. It is driving me crazy. Belo

Re: Tear me to shreds please...

2001-07-26 Thread Troy Denkinger
On Thursday 26 July 2001 02:30, you wrote: First, do use strict and make the changes necessary to satisfy it. It's a good habit to get into and would be a good learning experience to work it into this code. This is not so much code that it would take all that long. > open (ADDSRC, "data.csv"

RE: Login error w/FTP

2001-07-26 Thread Bob Showalter
> -Original Message- > From: Sparkle Williams [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 10:13 AM > To: [EMAIL PROTECTED] > Subject: Login error w/FTP > > > Well, I have this script that I'm trying to write using the > FTP module, > however it keeps responding with an

Compiling into C source code.

2001-07-26 Thread Barry Carroll
Hi All, I have a perculiar problem: i have a perl script test.pl which i want to convert into C source. perlcc will work fine, is there any way of getting it to generate the C source and stop. I ask this because when i try 'perl -M0=CC, -otest3.pl.c test3.pl' it doesn't work, it says '-o' is

Array::compare question

2001-07-26 Thread Diego Riaño
Hi everybody Does someone know if the array::compare module can handle array of arrays? Thanks in advances DiegoM -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Compiling into C source code.

2001-07-26 Thread Barry Carroll
sorry, i figured this one out myself, thanks anyway! :) -Original Message- From: Barry Carroll [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 3:24 PM To: '[EMAIL PROTECTED]' Subject: Compiling into C source code. Hi All, I have a perculiar problem: i have a perl script test

Re: how to get an array index number

2001-07-26 Thread Birgit Kellner
--On Donnerstag, 26. Juli 2001 04:15 +0200 Birgit Kellner <[EMAIL PROTECTED]> wrote: > Hi, > > I'm thinking of coding a KWIC search through a text. The user chooses a > search string and a horizon, meaning that output is to contain $i words > to the left and to the right of the search string (if

Re: Another pattern question

2001-07-26 Thread Paul
--- Daniel Mester <[EMAIL PROTECTED]> wrote: > Hi again, > for example i have a file like : > zxcv zxcv > qwer asdf > bnmm sdfgy > > I need to split the sentences into a variables in list. > So i do it in 2 stages: > 1. Remove the \t form each pair: > foreach (@list) { push(@temp, (split(/\t

RE: Login error w/FTP

2001-07-26 Thread Sparkle Williams
I went back and used chomp on all of the scalar variables, but I still recieved the same error message which is listed below. The referred to in line 5 is 'chomp($url = ) ;' Can't call method "login" on an undefined value at D:\sparkle\perl6.pl line 50, line 5. >From: "Daniel Mester" <[EM

RE: Comparing two text files and outputting difference

2001-07-26 Thread Najamuddin, Junaid
Is someone out there to help me please Thanx > -Original Message- > From: Najamuddin, Junaid > Sent: Wednesday, July 25, 2001 5:59 PM > To: '[EMAIL PROTECTED]' > Subject: Comparing two text files and outputting difference > > Hi, > > I am brand new on Perl > Learning s

code doesn't work

2001-07-26 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi, Can anybody tell me why this code doesn't work ? #!/usr/bin/perl -w open(FICHIER,"rdn1.html"); open (TEMP,">>temp.html"); while() { print TEMP $_ until ($_ =~m/ancre/); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: code doesn't work

2001-07-26 Thread Brett W. McCoy
On Thu, 26 Jul 2001, COLLINEAU Franck FTRD/DMI/TAM wrote: > Can anybody tell me why this code doesn't work ? > > #!/usr/bin/perl -w > > open(FICHIER,"rdn1.html"); > open (TEMP,">>temp.html"); > while() > { > print TEMP $_ until ($_ =~m/ancre/); > > > } Hard to say without knowing what erro

RE: code doesn't work

2001-07-26 Thread Bob Showalter
> -Original Message- > From: COLLINEAU Franck FTRD/DMI/TAM > [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 11:12 AM > To: Perl (E-mail) > Subject: code doesn't work > > > Hi, > > Can anybody tell me why this code doesn't work ? Define "doesn't work" > > #!/usr/bin/perl

RE: code doesn't work

2001-07-26 Thread Mooney Christophe-CMOONEY1
i think you want to use 'unless' instead of 'until'. also, take advantage of $_'s magic in your print statement: print TEMP unless /ancre/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

__TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
Where can i find out more information about the __TAGS__ ? BTW what are they really called? Are they directives? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Another pattern question

2001-07-26 Thread Abdulaziz Ghuloum
Hello, I think what you want to do is first remove the newline character _then_ split the list. ie. open F, " my @list; while(){ chomp; # remove the \n push @list, split/\t+/; # add items to @list } Hope this helps,,, Aziz,,, In article <000901c115e3$31a71ec0$[EMAIL PROTECTED]>, "Dani

system specific - Perl resource kit -segmentation fault

2001-07-26 Thread Giridhar nandikotkur
Hi Anyone I have a red hat 6.2 PII system. i tried to install perl resource kit cdrom 1997 on my machine which has 5.--4 and 5.--45 on it. I get a segmentation fault during installation. My machine has 5.005 version of perl. Any suggestions as to where I can find documentation on this issue? I ha

Re: regexp issues TR

2001-07-26 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Teresa Raymond said: >I tried the following code to test for bad characters but keep >getting my error msg though the values passed do not contain chars >that are not "A-Za-z0-9_@.-" (I also reread my last post and found >that my English articulation was very poor, I'm grateful that

Re: __TAGS__

2001-07-26 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 26, Mooney Christophe-CMOONEY1 said: >Where can i find out more information about the __TAGS__ ? > >BTW what are they really called? Are they directives? These are documented in perlsyn: __END__ end of program __DATA__ end of program, but allow this to be accessed via *PKG:

costing

2001-07-26 Thread ERIC Lawson - x52010
Hi, I have a text-based, variable record length database (a set of bibliographic references) of approx. 1 megabite and growing, for which I'm creating a command line dbms with perl. Could anybody here tell me if it's going to be quicker to address the data via an ancillary fixed length (text-bas

RE: appending to file?

2001-07-26 Thread Venkat Mohan
I guess Perl does a buffered write. Soo the un filled buffers may not get flushed when the process terminates abruptly as it does in C. David, What made that APPEND to work. If you don't mind can you explain? Thanks, Venkat -Original Message- From: Stephen P. Potter [mailto:[EMAIL PRO

RE: appending to file?

2001-07-26 Thread Venkat Mohan
You can use signal handlers $::SIG{__DIE__} = \&cgi_die; This will be invoke cgi_die sub when ever the script dies You can also look at perldoc sigtrap Same signal names used in unix signal used here. I suggest to look at sigtrap perldoc - Venkat -Original Message- From: David Fr

RE: __TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
Actually, i checked in perlsyn. It uses a couple of them in examples at the very end, but doesn't really talk about them. I frequently use the __END__ tag while i'm debugging so that i can easily "comment out" a chunk of code at the end. I'm also using the __DATA__ tag, and i was worried that t

RE: appending to file?

2001-07-26 Thread David Freeman
Not sure i understand the question. the append works because i did the syntax for it correctly? open(APPEND,">>testfile") || die print "Can't open testfile: $!\n"; # i state i want to open this filehandle and append >> the data to the file testfile, otherwise die if # you can't open testfile

RE: Date verification

2001-07-26 Thread Wagner-David
This may be too much but validation of date info to me is necessary. Otherwise junk in , junk out. All too often people put 9/31/01 which is invalid. So why not use the system to make sure. SO just using timelocal and localtime, you can make sure that the date entered is valid. #!perl -w

Weekly list FAQ posting

2001-07-26 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address)

Re: Date verification

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 10:26:45AM -0700, Wagner-David wrote: I'm not sure if you wanted a code review for this, but one follows. > #!perl -w > > use Time::Local; > > my @DateUse = (); There's no need to initialize @DateUse like this, arrays start empty. You should move this into the while

perl on NT

2001-07-26 Thread Khan, Masuma
Hello, I used to know perl. And now I forgotten it all. I used it to make perl cgi scripts that used to run of a UNIX server. But now, I have to make perl/cgi scripts that run of an NT server and I'm really stuck! I tried running the hello world script, well not run it, but is used it as the acti

"last until eof unless" question

2001-07-26 Thread David Freeman
in my script i have the line currently reading last unless $email; i changed it to read last until eof unless $email; i get a error message for "eof unless" for a syntax error. Is there a proper way to phrase this type of arguement so it would work? David M.R. Freeman webmaster sysadmin f

Re: "last until eof unless" question

2001-07-26 Thread Abdulaziz Ghuloum
Hello, What does "last until eof unless email" mean? I don't get what you're after. Can you explain what you're trying to do or include a snippet from your program. Aziz,,, In article <5.0.0.25.0.20010726113250.00a199b0@linus>, "David Freeman" <[EMAIL PROTECTED]> wrote: > in my script i have

Renaming Files Help

2001-07-26 Thread jbarry
I keep getting an error when I run this script - No such file or directory. What am I missing? #!/usr/bin/perl -w #rename use File::Find; $DIRLIST = ('D:\PATH\To-Be Model\Data'); find(\&process_file, $DIRLIST); rename_files(); sub process_file{ push (@files, $_); }; sub rename_files{

Re: "last until eof unless" question

2001-07-26 Thread David Freeman
well, i'm strictly speaking from a grammatical point of view, but it would seem to me that a last until eof unless $email; would be a valid syntax to go through to the end of the file unless $email was found. i'm not sure that this is what i want to do, but i thought i would see what would

if in a list

2001-07-26 Thread Jennifer Pan
I want to test if "AF1" is in my list @mylist; I did: foreach $LIST (@mylist) { if ($LIST = "AF1") $boolean = 1; else $boolean = 0; } is there a more elegant way to do it? many thanks jennifer -- To unsubscribe, e-mail: [EMAIL PROTEC

RE: if in a list

2001-07-26 Thread Mooney Christophe-CMOONEY1
That depends on what you're using @mylist for. If you're simply using it to check to see if an element is in the list, then use a hash instead. If you're creating the list element - b push @mylist, $whatever; you can say $myhash{$whatever}=1; Then your search-loop collapses into

RE: if in a list

2001-07-26 Thread Venkat Mohan
One thing When you compare strings use "eq" string comparition operator. Not "=" -Venkat -Original Message- From: Jennifer Pan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 11:55 AM To: [EMAIL PROTECTED] Subject: if in a list I want to test if "AF1" is in my list @myli

Re: __TAGS__

2001-07-26 Thread Paul Johnson
On Thu, Jul 26, 2001 at 12:21:38PM -0400, Jeff 'japhy/Marillion' Pinyan wrote: > On Jul 26, Mooney Christophe-CMOONEY1 said: > > >Where can i find out more information about the __TAGS__ ? > > > >BTW what are they really called? Are they directives? They seem to be called "special literals". >

RE: if in a list

2001-07-26 Thread Mooney Christophe-CMOONEY1
sorry -- that should read if you're creating the list element-by-element like this: push @mylist, $whatever; you can replace it with this: $myhash{$whatever}=1; -Original Message- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 2:

Re: if in a list

2001-07-26 Thread Brett W. McCoy
On Thu, 26 Jul 2001, Jennifer Pan wrote: > I want to test if "AF1" is in my list @mylist; > > I did: > > foreach $LIST (@mylist) { > if ($LIST = "AF1") > $boolean = 1; > else > $boolean = 0; > } > > is there a more elegant way to do it? Sure is. F

RE: __TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
perlDATA!! thank you! -Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 2:11 PM To: [EMAIL PROTECTED] Cc: Mooney Christophe-CMOONEY1; [EMAIL PROTECTED] Subject: Re: __TAGS__ On Thu, Jul 26, 2001 at 12:21:38PM -0400, Jeff 'japhy/Marillion' Pi

RE: if in a list

2001-07-26 Thread Jennifer Pan
many thanks, jos and maxim, your suggestions were very helpful. jennifer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: perl on NT

2001-07-26 Thread Rob Hanz
Masuma, Yes, you need to have perl installed on the NT machine. http://www.activestate.com has a (the?) binary distributable. Perl is an interpreted language, and as such needs an interpreter. It just happens that almost every *nix install has perl by default. They also include the equivalent

RE: "last until eof unless" question

2001-07-26 Thread Mooney Christophe-CMOONEY1
I don't think 'last until eof' will do what you think it's going to do. If 'eof' is true, then the loop exits, and if it's false then it exits anyway because of the 'last' statement. If you're trying to read from STDIN until you get a proper response from the user, then do something like this:

Re: "last until eof unless" question

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 11:35:14AM -0700, David Freeman wrote: > last until eof unless $email; You can't chain trailing modifiers like that. It also doesn't make much sense: you can't last until eof, because you can only last once; you're not reading from the file, so you'll never reach eof. Ig

Re: Renaming Files Help

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 01:42:11PM -0500, [EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w You forgot use strict. Always use strict when debugging code. > #rename > use File::Find; > $DIRLIST = ('D:\PATH\To-Be Model\Data'); > find(\&process_file, $DIRLIST); > rename_files(); > > sub process_file

Re: if in a list

2001-07-26 Thread Jos I. Boumans
I'd actually be surprised if that works... let me point out a few things: if ($list = 'foo') will always be true.. you are assigning 'foo' to $list what you want is probably 'eq' the if block also needs curly brackets {} around it, especially if you want to use the 'else' part more so, assumign

Re[2]: if in a list

2001-07-26 Thread Maxim Berlin
Hello Jennifer, Thursday, July 26, 2001, Maxim Berlin <[EMAIL PROTECTED]> wrote: MB> $boolean = grep /AF1/,@mylist; sorry, incorrect sample. should be: $boolean = grep /^AF1$/,@mylist; with first regexp you catch every string, that contain 'AF1'. thanks to Mooney Christophe. Best w

Re: if in a list

2001-07-26 Thread Maxim Berlin
Hello Jennifer, Thursday, July 26, 2001, Jennifer Pan <[EMAIL PROTECTED]> wrote: JP> I want to test if "AF1" is in my list @mylist; JP> I did: JP> foreach $LIST (@mylist) { JP> if ($LIST = "AF1") JP> $boolean = 1; JP> else JP> $boolean

RE: Renaming Files Help

2001-07-26 Thread jbarry
Nevermind, I figured it out. I'm only passing the file name in the rename script, I had to add the whole path to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 1:42 PM To: [EMAIL PROTECTED] Subject: Renaming Files Help I keep gett

Expect

2001-07-26 Thread Kipp, James
Does anyone know where to find good information on the expect module? the camel book did not say much about it. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: "last until eof unless" question

2001-07-26 Thread Paul
--- David Freeman <[EMAIL PROTECTED]> wrote: > while(1){ > last until eof unless $email; Okay, this is a seriously wierd constructm lol... =o) First of all "last until" is a logical oxymoron. "last" breaks out of a loop, "until" makes one. It's a statement that *could* only execute once at

Re: if in a list

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 11:24:12PM +0400, Maxim Berlin wrote: > Thursday, July 26, 2001, Maxim Berlin <[EMAIL PROTECTED]> wrote: > > MB> $boolean = grep /AF1/,@mylist; > sorry, incorrect sample. should be: > $boolean = grep /^AF1$/,@mylist; > with first regexp you catch every string, that

RE: "last until eof unless" question

2001-07-26 Thread Bob Showalter
> -Original Message- > From: David Freeman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 2:47 PM > To: [EMAIL PROTECTED] > Subject: Re: "last until eof unless" question > > > > > well, i'm strictly speaking from a grammatical point of view, > but it would > seem to me t

pushing into a hash

2001-07-26 Thread Mooney Christophe-CMOONEY1
Does anyone know of a slick way to put an array into a hash? For example, given %a= ( -a => 1, -b => 2, -c => 3 ); @b=qw/-x 24 -y 25 -z 26/; Is there a nice way to merge the hash implied by @b into %a to get %a= ( -a => 1, -b => 2, -c => 3,

Re: pushing into a hash

2001-07-26 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 26, Mooney Christophe-CMOONEY1 said: >@b=qw/-x 24 -y 25 -z 26/; > >Is there a nice way to merge the hash implied by @b into %a to get while (@b) { my ($k, $v) = splice @b, 0, 2; $a{$k} = $v; } You could write %a = (%a, @b); but that's potentially slow and ugly. -- Jeff

Re: if in a list

2001-07-26 Thread M.W. Koskamp
- Original Message - From: Brett W. McCoy <[EMAIL PROTECTED]> To: Jennifer Pan <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, July 26, 2001 9:12 PM Subject: Re: if in a list [...] > > Here's how I would code this: > > foreach (@mylist) { > > $boolean = ($_ eq 'AF1') ?

Pipe usage

2001-07-26 Thread Frank Newland
I want to print the contents of an archived file. When I run this script, all it does is uncompress my file. Q: 1. Isn't CONTENTS a file handle to the uncompressed file? 2. Why doesn't perl execute my while statement? 3. What should I do to print the contents of an archived file?

Re: Pipe usage

2001-07-26 Thread Brett W. McCoy
On Thu, 26 Jul 2001, Frank Newland wrote: > I want to print the contents of an archived file. When I run this script, > all it does is uncompress my file. > > Q: > 1. Isn't CONTENTS a file handle to the uncompressed file? No. I think what you want is uncompress -c, which dumps the file to stand

Re: pushing into a hash

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 04:52:28PM -0400, Jeff 'japhy/Marillion' Pinyan wrote: > On Jul 26, Mooney Christophe-CMOONEY1 said: > > >@b=qw/-x 24 -y 25 -z 26/; > > > >Is there a nice way to merge the hash implied by @b into %a to get > > while (@b) { > my ($k, $v) = splice @b, 0, 2; > $a{$

Re: Pipe usage

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 04:18:58PM -0500, Frank Newland wrote: > Q: > 1. Isn't CONTENTS a file handle to the uncompressed file? No, it's a filehandle to the output of the compress command. > 2. Why doesn't perl execute my while statement? It does, but there's nothing to read, see below. > 3.

Re: Unix syntax

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sparkle Williams" <[EMAIL PROTECTED]> whispered: | I wrote a program running off a Windows NT platform and was trying to | convert it to a UNIX platform. My problem comes with my syntax. I keep | recieving an error message and was hoping someone could hel

Re: Running Perl scripts...

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Daniel Falkenberg whispered: | I want to be able to check for errors on my Linux box before I run them in a | browser. The problem is is tha when I do this all my HTML is dispalyed. I | don't want to see this I want to be able to just check for any errors

Re: STDIN

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sparkle Williams" <[EMAIL PROTECTED]> whispered: | Is there any other way to input information through STDIN other than using | $variable = ? I have a script that requires multiple values of | STDIN, each one different, but the script reads each of the c

Re: stat() keeps returningthe incorrect date

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Shepard, Gregory R" whispered: | while ($file=readdir DIR) readdir() returns a filename, not a complete pathname. So, for example, if you do a readdir("/etc"), you'll get back things like ".", "..", "passwd", "shadow", "hosts", etc. If you happen

Re: Date problem

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and [EMAIL PROTECTED] (F.H) whispered: | Hi, | does anyone know how to convert a date from mmddyy to mmdd? | so 010201 becomes 01022001 I've seen a couple of people respond to you using all sorts of date manipulation routines. Even I had a hard time followi

Re: appending to file?

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Venkat Mohan <[EMAIL PROTECTED]> wh ispered: | --_=_NextPart_001_01C1155C.C049A170 | Content-Type: text/plain; | charset="iso-8859-1" | | Are you closing the APPEND file at the end of the process? As long as the process terminates, the close() wil

Re: checking for true/false after a command has run

2001-07-26 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Stephanie Stiavetti <[EMAIL PROTECTED]> whispe red: | you know, our super webmaster perl guy said that you shouldn't use || in die | statements, because in the order of precedence || comes before 'or' and that | in a die statement, it can mess things up. | |

Re: setting and importing ENV from within PERL

2001-07-26 Thread perl newbie
I am trying to figure out if there is a way to : a) set an ENV variable from within a perl script and then print out it's value from within the same shell. Here is the code that I am trying to use: #!/usr/bin/perl -w use strict; # set some environment variables. system(`setenv MY_VAR "test"`

How to Insert Array Elements Sequentially

2001-07-26 Thread Rashid Faraby
Hi Folks, I've been struggling with this for a couple of hours this morning and it seems like I'll need some help from the pros. I have a long file consisting of document numbers. I would like to insert sequentially a number into records saved in another file I am data munging through a while

FW: thanks

2001-07-26 Thread Bedford, Donald T.
I second Debbie's kudos to the group. I've been around for 18 years and this group is one of the most unselfish, helpful and non-flaming I've seen. Thank you for your good work... -don -Original Message- From: Debbie Christensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 12

Inserting Array Elements sequentially

2001-07-26 Thread Rashid Faraby
Hi Folks, [I sent this post this morning but it doesn't look like made it. So I'm resending it!] I've been struggling with this for a couple of hours this morning and it seems like I'll need some help from the pros. I have a long file consisting of document numbers. I would like to insert s

RE: setting and importing ENV from within PERL

2001-07-26 Thread Venkat Mohan
$ENV{MY_VAR} = "test"; will set the env var MY_VAR -Venkat -Original Message- From: perl newbie [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 3:22 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: setting and importing ENV from within PERL I am trying to figure

Why does this conditional fail? Perl bug?

2001-07-26 Thread Bob Bondi
Probably not a Perl bug, but this is so confusing I' probably enter it as a bug Given the script below and the fact that you run it like: > perl foo.pl -p 10.0.0.1 -s 8080 -t SOS what would you expect the output to be? use strict; use Getopt::Std; my %opts = (); getopt('pst', \%opts);

Re: Why does this conditional fail? Perl bug?

2001-07-26 Thread Dan Grossman
On Thu, 26 Jul 2001, Bob Bondi wrote: > Probably not a Perl bug, but this is so confusing I' probably > enter it as a bug > > Given the script below and the fact that you run it like: > > perl foo.pl -p 10.0.0.1 -s 8080 -t SOS > > what would you expect the output to be? > > use strict;

Re: pushing into a hash

2001-07-26 Thread Paul
--- Mooney Christophe-CMOONEY1 <[EMAIL PROTECTED]> wrote: > Does anyone know of a slick way to put an array into a hash? > > For example, given > > %a= > ( > -a => 1, > -b => 2, > -c => 3 > ); > @b=qw/-x 24 -y 25 -z 26/; > > Is there a nice way to merge the hash implied by @b

Re: pushing into a hash

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 05:27:28PM -0700, Paul wrote: > sub pushHash (\%@) { # somebody please check that prototyping > local *INHASH = shift; This is clever, but should probably be avoided (mostly because it's clever). > my %tmpHash = ( @_ ); > @INHASH{keys %tmpHash} = value

Re: How to Insert Array Elements Sequentially

2001-07-26 Thread Abdulaziz Ghuloum
Hello, There are a few problems in the program you included. First is the use of split outside the loop which is not what you want. Second is using the /.?/ expression to test the length of the field where you should've used the "length" function. I guess what you needed was a way to add the

  1   2   >