Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> Well, yes, but the way you've designed this, you already run that risk. > > Now if you replaced get_scriptname() with get_subroutine(), and found a > way to abstract out the bits that are different for each $recipient, > then you could simplify things tremendously, and hopefully make your > r

Re: I think I need another regex...

2005-03-17 Thread Renqilong
Got it!Thanks a lot,John! On Thu, 17 Mar 2005 20:38:21 -0800 "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Renqilong wrote: > > On Thu, 17 Mar 2005 12:55:02 -0800 > > "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > > >>Chris Knipe wrote: > >> > >>>I tried to do this with split(), but it's not work

Re: I think I need another regex...

2005-03-17 Thread John W. Krahn
Renqilong wrote: On Thu, 17 Mar 2005 12:55:02 -0800 "John W. Krahn" <[EMAIL PROTECTED]> wrote: Chris Knipe wrote: I tried to do this with split(), but it's not working good at all The string: interface=something very long with spaces and all mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=1

Re: I think I need another regex...

2005-03-17 Thread Renqilong
On Thu, 17 Mar 2005 12:55:02 -0800 "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Chris Knipe wrote: > > Lo all, > > Hello, > > > I tried to do this with split(), but it's not working good at all > > > > The string: > > interface=something very long with spaces and all > > mac-address=00:02:

RE: Use of uninitialized value

2005-03-17 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : The idiom I use every single day: : : #!/usr/bin/perl : : use strict; : use warnings; : use diagnostics; My idiom, which is used a lot for testing code on various beginner lists, is this. I never did care for the verbose output of diagn

Re: ActivePerl repositories

2005-03-17 Thread Jenda Krynicky
From: Peter Rabbitson <[EMAIL PROTECTED]> > I have a general question concerning module availability for > ActiveState Perl. I asked on this list several month ago where to get > the DateTime suite modules, and somebody pointed me to a certain > repository at the University of Winnipeg. Now I am in

Re: Use of uninitialized value

2005-03-17 Thread Lawrence Statton
> Hi all. > if ($value) { > if ($value eq "some_value_to_compare_to") { ># stuff > } else { ># other stuff > } > } else { ># same as other stuff above > } > > But this makes things look overly complicated, increases the size of my > code, and I assume slows thi

Re: Use of uninitialized value

2005-03-17 Thread Randy W. Sims
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Daniel Kasak wrote: Hi all. I'm after people's thoughts on Perl's warnings about 'Use of uninitialized value' in various situations ( string comparisons, subroutine entries, etc ). I understand what the warning is for. In my code, it's perf

Re: ActivePerl repositories

2005-03-17 Thread Bob Showalter
Peter Rabbitson wrote: I have a general question concerning module availability for ActiveState Perl. I asked on this list several month ago where to get the DateTime suite modules, and somebody pointed me to a certain repository at the University of Winnipeg. Now I am in need of HTTP::Cookies and

RE: Use of uninitialized value

2005-03-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Daniel Kasak wrote: > Hi all. > > I'm after people's thoughts on Perl's warnings about 'Use of > uninitialized value' in various situations ( string comparisons, > subroutine entries, etc ). > I understand what the warning is for. > In my code, it's perfectly OK for my variables to be uninitialise

Use of uninitialized value

2005-03-17 Thread Daniel Kasak
Hi all. I'm after people's thoughts on Perl's warnings about 'Use of uninitialized value' in various situations ( string comparisons, subroutine entries, etc ). I understand what the warning is for. In my code, it's perfectly OK for my variables to be uninitialised, and is beyond my control anyw

Re: ActivePerl repositories

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 18:39:53 -0500, Peter Rabbitson wrote: > and it is pretty much up to the good will of someone to compile a > certain module and and serve it from a local server? > That's pretty much the situation. Of course, there's always Google :-) In any case, for HTTP::Cookies you don't h

ActivePerl repositories

2005-03-17 Thread Peter Rabbitson
I have a general question concerning module availability for ActiveState Perl. I asked on this list several month ago where to get the DateTime suite modules, and somebody pointed me to a certain repository at the University of Winnipeg. Now I am in need of HTTP::Cookies and instead being pinpoi

Re: changing selected values in optionmenus in perl tk

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 12:56:33 -0500, BJ <[EMAIL PROTECTED]> wrote: > Is it possible to change the selected value through software and have > the results change on the screen? A very simple example would be if I > had a form with optionmenu's that I was using for data entry, and I > wanted to reset a

Re: I think I need another regex...

2005-03-17 Thread John W. Krahn
Chris Knipe wrote: Lo all, Hello, I tried to do this with split(), but it's not working good at all The string: interface=something very long with spaces and all mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps packets=12623,18377 bytes=10829240,2009327 frames=12623,18

Re: Taking Multiple Files in Pairs and Run it Iteratively

2005-03-17 Thread John W. Krahn
Edward Wijaya wrote: On Tue, 15 Mar 2005 02:29:06 +0800, John W. Krahn <[EMAIL PROTECTED]> wrote: Edward Wijaya wrote: [snip] Here is one way to do it: my %files; for ( @ARGV ) { next unless /(.+)\.(?:fa|rs)$/; push @{ $files{ $1 } }, $_; } for my $base ( keys %files ) { if ( @{

Re: Type-globbing filehandles

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 12:54:23 -0600, Dave Kettmann wrote: > Here is the whole first part. Snipped part is just declaration of variables. > Okay, here is the problem: > > use File::Remote qw(:replace); > The problem is, when you use the ":replace" tag, File::Remote imports new "open" and "close"

RE: Type-globbing filehandles

2005-03-17 Thread Dave Kettmann
Here is the whole first part. Snipped part is just declaration of variables. The reason I'm 'reinventing the wheel' is for compatibility across systems that dont have the module installed. I'm trying to get away with installing as few extra modules as possible. #!/usr/bin/perl # March 1

changing selected values in optionmenus in perl tk

2005-03-17 Thread BJ
Is it possible to change the selected value through software and have the results change on the screen? A very simple example would be if I had a form with optionmenu's that I was using for data entry, and I wanted to reset all the optionmenu's to their default value after the "submit" button i

Re: Calling a perl script within another

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 11:19:39 -0500, Jay Savage wrote: > >my $loopscript = $scripts{the_one_I_need} ; >my ($loadargv1, $loadargv2, $loadargv3) = ($var1, $var2, $var3) ; >$loopscript =~ s/^(.+)/[EMAIL PROTECTED] = \($loadargv1, $loadargv2, > $loadargv3\);/; >exec $loopscript ; > >

Re: Calling a perl script within another

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 11:40:10 -0500, zentara wrote: > > > >{ > > > >$script = foo(); > >$output = `perl $script $a $b $c `; > >do_someting($output); > >... > >} > > > >The above works fine , but I do not want to fork out a new perl process > >every time. Is there a way I can avoid this. I would

Re: I think I need another regex...

2005-03-17 Thread Dave Gray
On Thu, 17 Mar 2005 11:32:23 -0500, Dave Gray <[EMAIL PROTECTED]> wrote: > > I tried to do this with split(), but it's not working good at all > > > > The string: > > interface=something very long with spaces and all > > mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps >

Re: I think I need another regex...

2005-03-17 Thread Dave Gray
> I tried to do this with split(), but it's not working good at all > > The string: > interface=something very long with spaces and all > mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps > packets=12623,18377 bytes=10829240,2009327 frames=12623,18377 > (the above is one

Re: Calling a perl script within another

2005-03-17 Thread Jay Savage
On Thu, 17 Mar 2005 09:32:43 -0500 (EST), Chris Devers <[EMAIL PROTECTED]> wrote: > On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > > > Okay, so we're back to my other suggestion -- "require" it: > > > > > > { > > > $script = get_name_of_script(); # names matter! pick good ones

Re: Determining standard perl modules

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 10:48:30 -0500, Chris Charley wrote: > > > Dear all, > > > > How/where do I find out the standard bundled perl modules > > Hello Gavin, > > perldoc perlmodlib > > and then scroll to Standard Modules > > Chris > Or on the web, see: "http://search.cpan.org/dist/perl-/", e.g

Re: Determining standard perl modules

2005-03-17 Thread Chris Charley
- Original Message - From: "Gavin Henry" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Thursday, March 17, 2005 4:05 AM Subject: Determining standard perl modules Dear all, How/where do I find out the standard bundled perl modules Hello Gavin, perldoc perlmodlib and then scro

Re: Type-globbing filehandles

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 08:46:55 -0600, Dave Kettmann wrote: > > > > open (CFG, "/etc/backup.conf") or die "Can't open config file: $!\n"; > while () { > } > close CFG; > > > > Ok so when I run my program like this .. it complains on the the open() line > and the close() line. > It

Type-globbing filehandles

2005-03-17 Thread Dave Kettmann
Hi all, I think I am using the term (Type-globbing) correctly but we will see... I have a program I am making that needs to read lines from a file. Here is a snip of code to show what I'm doing... #/usr/bin/perl use strict; use warnings; my (%User_Preferences, $var, $value); open (CFG,

I think I need another regex...

2005-03-17 Thread Chris Knipe
Lo all, I tried to do this with split(), but it's not working good at all The string: interface=something very long with spaces and all mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps packets=12623,18377 bytes=10829240,2009327 frames=12623,18377 (the above is one line

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > Okay, so we're back to my other suggestion -- "require" it: > > > > { > > $script = get_name_of_script(); # names matter! pick good ones! > > $output = require $script or > > die "Couldn't 'require' $script\n$

Re: Taking Multiple Files in Pairs and Run it Iteratively

2005-03-17 Thread Edward Wijaya
On Tue, 15 Mar 2005 02:29:06 +0800, John W. Krahn <[EMAIL PROTECTED]> wrote: Edward Wijaya wrote: [snip] Here is one way to do it: my %files; for ( @ARGV ) { next unless /(.+)\.(?:fa|rs)$/; push @{ $files{ $1 } }, $_; } for my $base ( keys %files ) { if ( @{ $files{ $base } } !

Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> Okay, so we're back to my other suggestion -- "require" it: > > { > $script = get_name_of_script(); # names matter! pick good ones! > $output = require $script or > die "Couldn't 'require' $script\n$!\n"; > do_something($output); > } > No I cant use

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > > If the code for $script is being generated by the foo() subroutine, then > > why are you not just eval()ing on the spot? > > > > { > > $script = foo(); > > $output = eval{ $script } or > > die "Couldn't eval

Re: Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
> If the code for $script is being generated by the foo() subroutine, then > why are you not just eval()ing on the spot? > > { > $script = foo(); > $output = eval{ $script } or > die "Couldn't eval code: $script\n$!\n"; > do_something($output); > } I

RE: platform independant log

2005-03-17 Thread Moon, John
Subject: platform independant log Hi : The following program needs to print the output of the cmd run to a log file, it takes care of the directory separator issue, so the log file could be created on any platform depending on where the program is run. But there is something missing ie the log fil

Re: Calling a perl script within another

2005-03-17 Thread Chris Devers
On Thu, 17 Mar 2005, Ramprasad A Padmanabhan wrote: > I have a requirement to call a perl script within another and take > the output Okay. The typical way to do this would be to make a module out of it, or at least a "require" call, but it looks like you may be generating the code dynamic

Calling a perl script within another

2005-03-17 Thread Ramprasad A Padmanabhan
Hi all, I have a requirement to call a perl script within another and take the output for example { $script = foo(); $output = `perl $script $a $b $c `; do_someting($output); ... } The above works fine , but I do not want to fork out a new perl process every time. Is there a way I can

Re: WWW::Mechanize java navigation (Answer)

2005-03-17 Thread Peter Rabbitson
On Thu, Feb 24, 2005 at 12:45:01PM -0500, Peter Rabbitson wrote: > Hello list. I had very good luck using the WWW::Mechanize object for various > automated data collectors until I stumbled over > http://www.mymerchantview.net. As you can imagine the problems begin when I > do my first ->follow_link

Determining standard perl modules

2005-03-17 Thread Gavin Henry
Dear all, How/where do I find out the standard bundled perl modules, like: use DirHandle; use Cwd; use Getopt::Std; use File::Path; use File::stat; use POSIX I am building some RPMS, and need to know if I have to explicitly define the module requirements, as they might already come with a stand

Re: Simple HASH query

2005-03-17 Thread perlmails
- Original Message - From: "SG Edwards" <[EMAIL PROTECTED]> To: Sent: Wednesday, March 16, 2005 10:10 AM Subject: Simple HASH query Hi, I am using bioperl to get the primary id of a protein out of a flat file as follows: while ($seq_obj = $seqio_obj->next_seq){ my $primary_id = $seq_o