RE: removing element of array

2004-05-14 Thread Charles K. Clarkson
Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] : : On May 14, Charles K. Clarkson said: : : >sub unmerge { : >my( @arr1, @arr2 ); : >/^!/ ? push @arr1, $_ : push @arr2, $_ foreach @{ $_[0] }; : : I like this better: : : push @{ /^!/ ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, $_ for

RE: removing element of array

2004-05-14 Thread Jeff 'japhy' Pinyan
On May 14, Charles K. Clarkson said: >sub unmerge { >my( @arr1, @arr2 ); >/^!/ ? push @arr1, $_ : push @arr2, $_ foreach @{ $_[0] }; I like this better: push @{ /^!/ ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, $_ for @{ $_[0] }; >return ( [EMAIL PROTECTED], [EMAIL PROTECTED] );

RE: removing element of array

2004-05-14 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > print Dumper $array1; : > : > @$array1 = grep ! /^!/, @$array1; : > : > print Dumper $array1; : : Well, I'm working with the data in the array at the same : time I'm trying to remove certain elements. I need to :

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I've modified your code to be more like it is in my program: : : #!/usr/bin/perl : : use strict; : use warnings; : use Data::Dumper 'Dumper'; : : my $array1 = ['test1', 'test2', 'test3', 'test4', '!test5', : 'test6', 'tes

RE: removing element of array

2004-05-14 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I've modified your code to be more like it is in my program: : : #!/usr/bin/perl : : use strict; : use warnings; : use Data::Dumper 'Dumper'; : : my $array1 = ['test1', 'test2', 'test3', 'test4', '!test5', : 'test6', 'test7']; : : print Dumper $ar

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Andrew Gaffney wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with and we can get you there. : >

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with and we can get you there. : > : > Starting w

Re: tuple

2004-05-14 Thread Jeff 'japhy' Pinyan
On May 14, stuart meacham said: >what's the difference between a tuple and a constan? Perl doesn't use the term 'tuple'. Can you explain your question a little more clearly? -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.per

RE: removing element of array

2004-05-14 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with and we can get you there. : > : > Starting with this: : > : > : my $ar

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I tried to write a small test script to figure this out, : but I can't get anywhere. I used array references in my : test program, because I need to pull out an element from : an array through a ref and assign the result back

RE: removing element of array

2004-05-14 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I tried to write a small test script to figure this out, : but I can't get anywhere. I used array references in my : test program, because I need to pull out an element from : an array through a ref and assign the result back to the : same array ref.

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Andrew Gaffney wrote: Wiggins d'Anconia wrote: Andrew Gaffney wrote: I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? perldoc -f delete perldoc -f splice Helps? A little, but I don't know how to put it all together. I tried to write a smal

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Wiggins d'Anconia wrote: Andrew Gaffney wrote: I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? perldoc -f delete perldoc -f splice Helps? A little, but I don't know how to put it all together. -- Andrew Gaffney Network Administrator Skylin

Re: removing element of array

2004-05-14 Thread Wiggins d'Anconia
Andrew Gaffney wrote: I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? perldoc -f delete perldoc -f splice Helps? http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

removing element of array

2004-05-14 Thread Andrew Gaffney
I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

tuple

2004-05-14 Thread stuart meacham
what's the difference between a tuple and a constan? Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Accumlating totals with File::Find

2004-05-14 Thread Rob Dixon
Hi Dermot. See my comments in line. Dermot Paikkos wrote: > > I am stuck. I have thousands of jpegs in hundreds of folders and I > would like to do a section by section tally of the number and file > sizes of all the files. > > I am using File::Find as it is quick and good at recursively > search

Re: [Perl-beginners] RE: Problem with use strict;

2004-05-14 Thread Remko Lodder
Hi, When I include the line use strict; in any perl program, I get the following error: "Internal Server Error What does occur when you run the file manually? perl -T $filename Perhaps that gives a possible error definition, Personally i tend to use ; use diagnostics; use warnings; use strict; so

RE: Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
Okay - got it. It now works prefacing $str = .. with my. Thanks everyone. -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 1:30 PM To: [EMAIL PROTECTED] Subject: Re: Problem with use strict; MCMULLIN, NANCY wrote: > But when I run the same c

Re: Problem with use strict;

2004-05-14 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: But when I run the same code with use strict commented out - it works just fine... 'use strict' enforces the use of 'my' or 'our' for variable declarations. If a variable declaration doesn't have that while 'use strict' is in effect, the program won't compile. -- Andrew Ga

RE: Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
But when I run the same code with use strict commented out - it works just fine... -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 1:15 PM To: MCMULLIN, NANCY; [EMAIL PROTECTED] Subject: RE: Problem with use strict; MCMULLIN, NANCY wrote: > Hi

RE: Problem with use strict;

2004-05-14 Thread Bob Showalter
MCMULLIN, NANCY wrote: > Hi there. > Brand new to PERL so please bear with me. (I'm running Win32/Apache) Hi. It's "Perl", not "PERL". You're excused since you're brand new :~) > > When I include the line > use strict; > in any perl program, I get the following error: > "Internal Server Error

Re: Problem with use strict;

2004-05-14 Thread WilliamGunther
In a message dated 5/14/2004 3:05:01 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: >Hi there. >Brand new to PERL so please bear with me. (I'm running Win32/Apache) > >When I include the line >use strict; >in any perl program, I get the following error: >"Internal Server Error Problem in

Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
Hi there. Brand new to PERL so please bear with me. (I'm running Win32/Apache) When I include the line use strict; in any perl program, I get the following error: "Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Pleas

Accumlating totals with File::Find

2004-05-14 Thread Dermot Paikkos
Hi Gurus, I am stuck. I have thousands of jpegs in hundreds of folders and I would like to do a section by section tally of the number and file sizes of all the files. I am using File::Find as it is quick and good at recursively searching dirs. The files are stored in folder under a letter, th

Re: Problem compare string with array

2004-05-14 Thread John Doe
Charles K. Clarkson wrote: John Doe <[EMAIL PROTECTED]> Wrote: : : Hello all, : i have problem, and i don't know where is my mistake. Your first mistake is not describing the problem in your message. A good programmer realizes that help comes best if the problem is stated clearly. Your se

Re: find outside ipadress of router with perl

2004-05-14 Thread Harry Putnam
bert huygens <[EMAIL PROTECTED]> writes: > Dear All, > > is it possible in Perl to find the outside ip-address from an adsl-router > without using an outside box. > > i need to restart a script when the outside address of the router changes Don't think you can get it without hitting a remot

RE: error while building perl

2004-05-14 Thread NYIMI Jose (BMB)
> -Original Message- > From: Christian Stalp [mailto:[EMAIL PROTECTED] > Sent: Friday, May 14, 2004 1:46 PM > To: [EMAIL PROTECTED] > Subject: error while building perl > > > Hello, > I just tryed to build perl with the gcc and got this dumped: > >`sh cflags "optimize='-O2'"

Re: find outside ipadress of router with perl

2004-05-14 Thread Wiggins d Anconia
> > Dear All, > > is it possible in Perl to find the outside ip-address from an adsl-router > without using an outside box. > > i need to restart a script when the outside address of the router changes > Not sure what you mean by "using an outside box"? Do you mean beyond the router? or o

Re: My & local

2004-05-14 Thread Wiggins d Anconia
> > Hi, > > can u tell me what is diference between my & local in perl with example. > > i am waiting ur favourable reply.. > An excellent read on this subject: http://perl.plover.com/FAQs/Namespaces.html Randal also has some articles on this in his list... http://danconia.org --

Re: tail -f does not exit

2004-05-14 Thread Claude
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: [...] Rob> You need to close and reopen the file if you want to check for a Rob> rename. Something like the program below. [...] Tx, Rob, I'll give feedback soon here! -- Claude -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

RE: error while building perl

2004-05-14 Thread NYIMI Jose (BMB)
> -Original Message- > From: Christian Stalp [mailto:[EMAIL PROTECTED] > Sent: Friday, May 14, 2004 2:58 PM > To: NYIMI Jose (BMB) > Cc: [EMAIL PROTECTED] > Subject: Re: error while building perl > > > Hey Jose, > the output is: > core file size (blocks) 2097151 > data seg size (kbyt

Re: My & local

2004-05-14 Thread David Dorward
On 14 May 2004, at 13:52, Asit Kumar wrote: can u tell me what is diference between my & local in perl with example. perldoc -q local my Found in /System/Library/Perl/5.8.1/pods/perlfaq7.pod What's the difference between dynamic and lexical (static) scoping? Between local() and my(

My & local

2004-05-14 Thread Asit Kumar
Hi, can u tell me what is diference between my & local in perl with example. i am waiting ur favourable reply.. With thanks & regards, Asit -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: find outside ipadress of router with perl

2004-05-14 Thread Andrew Gaffney
bert huygens wrote: Dear All, is it possible in Perl to find the outside ip-address from an adsl-router without using an outside box. i need to restart a script when the outside address of the router changes Yeah, use LWP to goto 'http://privacy.net/' and run the following regex against the

Re: error while building perl

2004-05-14 Thread Christian Stalp
Hey Jose, the output is: core file size (blocks) 2097151 data seg size (kbytes) 65536 file size (blocks) unlimited max memory size (kbytes)unlimited open files 2048 pipe size (512 bytes) 16 stack size (kbytes) 8192 cpu time (seconds) unl

RE: error while building perl

2004-05-14 Thread NYIMI Jose (BMB)
> -Original Message- > From: Christian Stalp [mailto:[EMAIL PROTECTED] > Sent: Friday, May 14, 2004 1:46 PM > To: [EMAIL PROTECTED] > Subject: error while building perl > > > Hello, > I just tryed to build perl with the gcc and got this dumped: > >`sh cflags "optimize='-O2'" t

CGI.pm / Upload File / delete temporary file (CGITemp****)

2004-05-14 Thread Babale Fongo
You don't have to bother about deleting it. GCI.pm takes care of that. HTH || ||Hi All, || ||Been ages since I last posted to this list... || ||Anyhoo, I have a script which handles the uploading of a file. || ||It uses the CGI module to get the form params etc and open/read/close ||statemen

Problem finding changes and differences between two lists?

2004-05-14 Thread arichmond(contr-ird)
Title: Message I am having difficulty discovering why a part of my script is doing what it is doing. I have a script that polls switches every 5 minutes to discover new MAC's. Everything works fine for discovering new MAC's but now I want to test for existing MAC's that have moved.   The co

Re: check my split

2004-05-14 Thread John W. Krahn
Rmck wrote: > > Hello, Hello, > This code below works. But I am wondering if it can be made more efficient: > >while () { > > my $sport = (split(/\s/,$_))[8]; > my $sdport = (split(/\s/,$_))[10]; > next if $sport =~ /\D/; > next if $dport =~ /\D/; >if ($sport =~ /^(20|21|22|25|53|80|10

error while building perl

2004-05-14 Thread Christian Stalp
Hello, I just tryed to build perl with the gcc and got this dumped: `sh cflags "optimize='-O2'" toke.o` toke.c CCCMD = /opt/gcc/bin/gcc -DPERL_CORE -c -D_HPUX_SOURCE -DUINT32_MAX_BROKEN -fno-strict-aliasing -D_LARGEFILE_SOURCE -DARG_ZERO_IS_SCRIPT -O2 -Wall toke.c: In funct

find outside ipadress of router with perl

2004-05-14 Thread bert huygens
Dear All, is it possible in Perl to find the outside ip-address from an adsl-router without using an outside box. i need to restart a script when the outside address of the router changes Greetings thx in advance - Do you Yahoo!? SBC Ya

RE: Problem compare string with array

2004-05-14 Thread Charles K. Clarkson
John Doe <[EMAIL PROTECTED]> Wrote: : : Hello all, : i have problem, and i don't know where is my mistake. Your first mistake is not describing the problem in your message. A good programmer realizes that help comes best if the problem is stated clearly. Your second mistake was not to in

RE: How to read a pdf file in perl

2004-05-14 Thread Mallik
Hi Dani, By the OS is AIX, similar to UNIX. So, is there any module to install in AIX (UNIX) and read the pdf file. Thanks, Mallik. -Original Message- From: Dani Pardo [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 1:57 PM To: [EMAIL PROTECTED] Cc: Mallik Subject: Re: How to read a

Re: Problem compare string with array

2004-05-14 Thread Rob Dixon
Hi John. See my reply in line. John Doe wrote: > > Hello all, > i have problem, and i don't know where is my mistake. > > --- > #!/usr/bin/perl use strict; # always use warnings; # usually which means that all your variables need to be declared with 'my'. > @myarra = ("test","error","blo

Re: tail -f does not exit

2004-05-14 Thread Rob Dixon
Claude" <[EMAIL PROTECTED]> wrote: > > I am reading continuously a file like this: > > open LOG, "junk.txt" or die "Cannot open $file, $!\n"; > while ( my $line = ) { > print "$line"; > } > > While appending lines to the file from a shell command line: > > $ echo "this is a new line" >

Re: Problem compare string with array

2004-05-14 Thread Durai
Corrceted One: @myarra = ("test","error","block"); $file = 'sorted'; # File contain records xxx.xxx.xxx # i need last symbols after last -> . open(FILE, $file); while ($data = ) { $backupdata = $data; $data =~ s/^(\S+)\.//g; # Remove xxx.xxx. get last 2 or 3 symbols #chomp($data); $d

Re: How to read a pdf file in perl

2004-05-14 Thread Dani Pardo
On Friday 14 May 2004 09:33, Mallik wrote: > Dear Friends, > > I want to parse a pdf file as we do for text files using perl. Can anyone > help me out? Hi, you may check PDF::API2, it's a pretty nice module. --- Dani Pardo, [EMAIL PROTECTED] ENPLATER S.A -- To unsubscribe, e-mail: [EMAIL PROTE

Problem compare string with array

2004-05-14 Thread John Doe
Hello all, i have problem, and i don't know where is my mistake. --- #!/usr/bin/perl @myarra = ("test","error","block"); $file = 'sorted'; # File contain records xxx.xxx.xxx # i need last symbols after last -> . open(FILE, $file); while ($data = ) { $backupdata = $data; $data =~ s/^(\S+)\.//

How to read a pdf file in perl

2004-05-14 Thread Mallik
Dear Friends, I want to parse a pdf file as we do for text files using perl. Can anyone help me out? Thanks, Mallik. - Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

tail -f does not exit

2004-05-14 Thread Claude
I am reading continuously a file like this: open LOG, "junk.txt" or die "Cannot open $file, $!\n"; while ( my $line = ) { print "$line"; } While appending lines to the file from a shell command line: $ echo "this is a new line" >> junk.txt Everything ok, except that I would like to