Re: File::Find .. still confused slightly

2017-07-05 Thread Harry Putnam
rea...@newsguy.com (Harry Putnam) writes: > What surprised me is the that when I ran them prefaced with the `time' > utility, I see the sloppy mess I wrote is nearly twice as fast. I may have found a reason. in the find sub {} part you did two returns return unless -f; return un

Re: File::Find .. still confused slightly

2017-07-05 Thread Harry Putnam
jimsgib...@gmail.com (Jim Gibson) writes: > You have a logic error in your code somewhere. Your logic for counting > the files with a name matching a certain pattern is too complicated to > follow and point out where your error lies and how to fix it. The > basic problem is that your logic depends

Re: File::Find .. still confused slightly

2017-07-05 Thread Jim Gibson
You have a logic error in your code somewhere. Your logic for counting the files with a name matching a certain pattern is too complicated to follow and point out where your error lies and how to fix it. The basic problem is that your logic depends upon detecting when the directory name changes,

File::Find .. still confused slightly

2017-07-05 Thread Harry Putnam
Working on script using File::Find to count the number of news posts in a semi-extensive hierarchy. As some may know, news posts are commonly stored in numeric named files, one file per posting. The following script tries to plow thru a hierarchy returning the directory name and file count for th

Re: Confused with File::Find

2017-06-25 Thread Harry Putnam
and...@geekuni.com (Andrew Solomon) writes: [...] > The way it works it that `find` is traversing through the directories and > `$File::Find::dir` is the directory it's *in* when it calls your subroutine > on `$File::Find::name` which is inside that directory. When it was sitting > in `/three` it

Re: Confused with File::Find

2017-06-24 Thread Andrew Solomon
Here's a small tweak to your initial script which goes some way toward shedding light on what was going wrong: #!/usr/bin/env perl use strict; use warnings; use File::Find; use feature 'say'; my $d = './one'; find sub { return if -f; say $File::Find::name; say "\$File::Find::dir<$Fi

Re: Confused with File::Find

2017-06-24 Thread Harry Putnam
shlo...@shlomifish.org (Shlomi Fish) writes: > $File::Find::dir is the containing directory of the path item (= the > dirname in http://perldoc.perl.org/File/Basename.html ). Finally, > note that File::Find has OK, I guess I follow that. As you see in my reply to Andrew S, I kind of fumbled my w

Re: Confused with File::Find

2017-06-24 Thread Harry Putnam
and...@geekuni.com (Andrew Solomon) writes: > Hi Harry > > What do you want your code to do? > Devise a simple test script the counts the number of directories in a hierarchy (This is building toward a more complex script in the end). But taking small steps in an effort to really understand what

Re: Confused with File::Find

2017-06-24 Thread Shlomi Fish
Hi Harry! On Fri, 23 Jun 2017 16:56:13 -0400 Harry Putnam wrote: > Trying for a better understand of using File::Find, butI'm missing > something pretty basic I think > > First: The directory structure in this test: > > ./one/tst.pl > two/tst.pl > three/tst.pl > > So each directory

Re: Confused with File::Find

2017-06-24 Thread Andrew Solomon
Hi Harry What do you want your code to do? Andrew On Fri, Jun 23, 2017 at 9:56 PM, Harry Putnam wrote: > Trying for a better understand of using File::Find, butI'm missing > something pretty basic I think > > First: The directory structure in this test: > > ./one/tst.pl > two/tst.pl >

Confused with File::Find

2017-06-23 Thread Harry Putnam
Trying for a better understand of using File::Find, butI'm missing something pretty basic I think First: The directory structure in this test: ./one/tst.pl two/tst.pl three/tst.pl So each directory in the layering has the same type -f file in it. Or ls -R ./one ./one: tst.pl tw

Re: confused about reference

2008-10-30 Thread Richard Lee
Richard Lee wrote: I was just testing some reference and while trying out below I am trying to understand below @{$yahoo->{yahoo}}... I can see that this is pointing to 0,1,3 by running the code. But I am trying to really understand whether this is trying to say since value of 'yah

confused about reference

2008-10-30 Thread Richard Lee
I was just testing some reference and while trying out below I am trying to understand below @{$yahoo->{yahoo}}... I can see that this is pointing to 0,1,3 by running the code. But I am trying to really understand whether this is trying to say since value of 'yahoo' is array put @ a

Re: confused about a regex

2007-03-08 Thread oryann9
Yes I understand now. For some reason I missed the missing quotes in the original post and the word token came to mind. $ perl -MO=Deparse foo.plx BEGIN { $^W = 1; } use diagnostics; sub abc { use warnings; use strict 'refs'; 'abc.'; } sub e { use warnings; use strict 'ref

Re: confused about a regex

2007-03-08 Thread Chas Owens
On 3/8/07, oryann9 <[EMAIL PROTECTED]> wrote: snip Why is $_=abc.e.i short for $_ = 'abc' . 'e' . 'i'; snip from "Programming Perl 3rd Edition": bareword A word sufficient ambigious to be deemed illegal under use strict 'subs'. In the absence of that stricture, a barew

Re: confused about a regex

2007-03-08 Thread oryann9
> $_=abc.e.i; > > This is short for: > > $_ = 'abc' . 'e' . 'i'; > > Which is the same as saying: > > $_ = 'abcei'; > Why is $_=abc.e.i short for $_ = 'abc' . 'e' . 'i'; Is it b/c each group of characters is a 'token' including the periods? abc => token . =>

Re: confused about a regex

2007-03-08 Thread Jeni Zundel
I have to say - I am totally enamored with regex. Color me 'goober'. I just think that is a beautiful, concise, elegant way to make a substitution. All of that capability in one short string of characters... No if, then, else construct. Just - capture what is there; if it matches a .\w

Re: confused about a regex

2007-03-07 Thread Chas Owens
On 3/7/07, Jennifer Foo <[EMAIL PROTECTED]> wrote: $_=abc.e.i; This is short for: $_ = 'abc' . 'e' . 'i'; Which is the same as saying: $_ = 'abcei'; Thanks.I never knew that it can write a string like this way. You probably shouldn't though. It is a carry over from the earli

Re: confused about a regex

2007-03-07 Thread Jennifer Foo
$_=abc.e.i; This is short for: $_ = 'abc' . 'e' . 'i'; Which is the same as saying: $_ = 'abcei'; Thanks.I never knew that it can write a string like this way. _ FREE Email @ Fadmail.com - http://www.fadmail.com --

Re: confused about a regex

2007-03-07 Thread John W. Krahn
Jennifer Foo wrote: > Someone posted this regex question which I can't understand for. > > perl -e '$_=abc.e.i; > s/(\.\w+)?$/.out/; > print;' > > the result is: abcei.out > > Why is this?Please help explain it.Thanks! $_=abc.e.i; This is short for: $_ = 'abc' . 'e' . 'i';

Re: confused about a regex

2007-03-07 Thread Chas Owens
On 3/7/07, Jennifer Foo <[EMAIL PROTECTED]> wrote: Someone posted this regex question which I can't understand for. perl -e '$_=abc.e.i; s/(\.\w+)?$/.out/; print;' the result is: abcei.out Why is this?Please help explain it.Thanks! I think you will be less confu

confused about a regex

2007-03-07 Thread Jennifer Foo
Someone posted this regex question which I can't understand for. perl -e '$_=abc.e.i; s/(\.\w+)?$/.out/; print;' the result is: abcei.out Why is this?Please help explain it.Thanks! _ FREE Email @ Fadmail.com - http://www.fa

Re: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-02-14 Thread Chas Owens
On 2/14/06, Wolcott, Kenneth A <[EMAIL PROTECTED]> wrote: > Hi; > > What is the correct path separator for "use lib" in a Perl program on > Windoze when I have multiple paths? Multiple "use lib" statements: use lib "/usr/local/perl"; use lib "/opt/perl"; use lib "~/perl"; > > What is the cor

Re: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-02-14 Thread Chas Owens
On 2/14/06, Chas Owens <[EMAIL PROTECTED]> wrote: > On 2/14/06, Wolcott, Kenneth A <[EMAIL PROTECTED]> wrote: > > Hi; > > > > What is the correct path separator for "use lib" in a Perl program on > > Windoze when I have multiple paths? > > Multiple "use lib" statements: > > use lib "/usr/local/pe

RE: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-02-14 Thread Wolcott, Kenneth A
7 AM To: Wolcott, Kenneth A Cc: beginners@perl.org Subject: Re: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630) On 1/20/06, Wolcott, Kenneth A <[EMAIL PROTECTED]> wrote: > Hi; > > It would be reall

Re: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-01-20 Thread Bob Showalter
Wolcott, Kenneth A wrote: Hi; It would be really nice if there was a clear, precise, concise, accurate and simple instruction of how to install Perl modules locally (non-privileged accounts) on Windows systems. http://www.cpan.org/misc/cpan-faq.html#How_install_Perl_modules really doesn

Re: still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-01-20 Thread Chas Owens
On 1/20/06, Wolcott, Kenneth A <[EMAIL PROTECTED]> wrote: > Hi; > > It would be really nice if there was a clear, precise, concise, > accurate and simple instruction of how to install Perl modules locally > (non-privileged accounts) on Windows systems. > snip > I really can't use ppm from activ

still confused on how to locally install perl modules without administrative privileges on windows (activestate 5.6.1 build 630)

2006-01-20 Thread Wolcott, Kenneth A
Hi; It would be really nice if there was a clear, precise, concise, accurate and simple instruction of how to install Perl modules locally (non-privileged accounts) on Windows systems. http://www.cpan.org/misc/cpan-faq.html#How_install_Perl_modules really doesn't help me perform local (non-

RE: Switch -- confused

2005-04-13 Thread David Gilden
Greetings, Thanks for the help so far, I am added switch... but not sure that I have syntax correct Maybe this is best written as if else logic and or: my $action = $q->param( "action" ); SWITCH ($action) { if (/Upload/) { last SWITCH; }; etc... -

Re: I'm confused: where are the commas for map and sort

2004-10-11 Thread David le Blanc
On Sun, 10 Oct 2004 14:30:32 -0600, Siegfried Heintze <[EMAIL PROTECTED]> wrote: > > The map and the sort statements are strange. Why don't they require a comma > between the first and second arguments? They are not special, they are just using a special semantic built into perl. Consider the fo

I'm confused: where are the commas for map and sort

2004-10-10 Thread Siegfried Heintze
The map and the sort statements are strange. Why don't they require a comma between the first and second arguments? Thanks, Siegfried -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread Jenda Krynicky
From: "Dennis G. Wicks" <[EMAIL PROTECTED]> > I just did extensive testing using ActiveState perl on XP-Pro > and I get the exact same results. > > C:\DATAFI~1>argv.pl testfile > > gives the unitialized variable message but > > C:\DATAFI~1>perl argv.pl testfile > > works as expected. It ain'

Re: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread David Kirol
08:29:45 -0400 (EDT) > > From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > > Reply-To: [EMAIL PROTECTED] > > To: Larry Wissink <[EMAIL PROTECTED]> > > Cc: [EMAIL PROTECTED] > > Subject: Re: Confused about supplying command line argum

RE: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread Larry Wissink
y' Pinyan [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 5:30 AM To: Larry Wissink Cc: [EMAIL PROTECTED] Subject: Re: Confused about supplying command line arguments and using @ARGV On Jun 2, Larry Wissink said: >I want to supply the name of a file on the command line when executing

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Dennis G. Wicks
400 (EDT) > From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > To: Larry Wissink <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: Confused about supplying command line arguments and using > @ARGV > > On Jun 2, Larry

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Jeff 'japhy' Pinyan
On Jun 2, Larry Wissink said: >I want to supply the name of a file on the command line when executing a >script. Unfortunately, I'm getting an error that says that @ARGV is >uninitialized. > >How do you initialize @ARGV? How do you specify command line arguments? You don't initialize @ARGV. It

Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Larry Wissink
Hi, I thought this would be simple... I want to supply the name of a file on the command line when executing a script. Unfortunately, I'm getting an error that says that @ARGV is uninitialized. How do you initialize @ARGV? How do you specify command line arguments? I'm using Windows XP, ac

Re: confused - if function

2004-04-28 Thread Jeff Westman
, mike wrote: > I am getting a bit confused here, if I uncomment out the print > statement > within the if block $date1 prints, however the $date1 after the if > block > doesn't > > if ($date eq ''){ > my $date1=localtime; > #print $date1; > } > else { >

Re: confused - if function

2004-04-27 Thread William.Ampeh
cc: Subject: confused - if function 04/27/2004 06:39

Re: confused - if function

2004-04-27 Thread James Edward Gray II
On Apr 27, 2004, at 5:39 AM, mike wrote: I am getting a bit confused here, if I uncomment out the print statement within the if block $date1 prints, however the $date1 after the if block doesn't if ($date eq ''){ my $date1=localtime; #print $date1; } else { my $date1=~$date;

confused - if function

2004-04-27 Thread mike
I am getting a bit confused here, if I uncomment out the print statement within the if block $date1 prints, however the $date1 after the if block doesn't if ($date eq ''){ my $date1=localtime; #print $date1; } else { my $date1=~$date; }; print $date1; any ideas -- To unsu

Re: Confused

2004-03-25 Thread WC -Sx- Jones
mike wrote: This worked s/\s+$/; One question will this only take out blank lines? eg: if I have this line anytext tabe space newline will the non-printing characters be removed and the text be added to the beginning of the next line? This will only remove whitespace from the END of a line. If

Re: Confused

2004-03-25 Thread mike
On Wed, 2004-03-24 at 14:19, James Edward Gray II wrote: > On Mar 24, 2004, at 7:59 AM, WC -Sx- Jones wrote: > > > while() { > > chomp; s/^\s+//; s/\s+$//; next unless length; > > There's probably not much reason to chomp() and s/\s+$//, since the > later handles both. > > James > Thanks

Re: Confused

2004-03-24 Thread WC -Sx- Jones
James Edward Gray II wrote: On Mar 24, 2004, at 7:59 AM, WC -Sx- Jones wrote: while() { chomp; s/^\s+//; s/\s+$//; next unless length; There's probably not much reason to chomp() and s/\s+$//, since the later handles both. Yes, and I forget that the way I used it chomp only gets ONE \n --

Re: Confused

2004-03-24 Thread James Edward Gray II
On Mar 24, 2004, at 7:59 AM, WC -Sx- Jones wrote: while() { chomp; s/^\s+//; s/\s+$//; next unless length; There's probably not much reason to chomp() and s/\s+$//, since the later handles both. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: Confused

2004-03-24 Thread John W . Krahn
On Wednesday 24 March 2004 06:07, John W. Krahn wrote: > On Tuesday 23 March 2004 13:13, mike wrote: > > I am trying to get rid of a blank line at the start of a text file, > > and I dont understand why this does not work > > > > open(UPD1,"tem");# this file exists > > You should *ALWAYS* verify th

Re: Confused

2004-03-24 Thread John W . Krahn
On Tuesday 23 March 2004 13:13, mike wrote: > > I am trying to get rid of a blank line at the start of a text file, > and I dont understand why this does not work > > open(UPD1,"tem");# this file exists You should *ALWAYS* verify that the file opened successfully. open UPD1, 'tem' or die "Cannot

Re: Confused

2004-03-24 Thread WC -Sx- Jones
mike wrote: I am trying to get rid of a blank line at the start of a text file, and I dont understand why this does not work open(UPD1,"tem");# this file exists my @update1=; foreach $update1(@update1){ $update1=~s/^(\n)//; while() { chomp; s/^\s+//; s/\s+$//; next unless length; $update1

Confused

2004-03-24 Thread mike
I am trying to get rid of a blank line at the start of a text file, and I dont understand why this does not work open(UPD1,"tem");# this file exists my @update1=; foreach $update1(@update1){ $update1=~s/^(\n)//; $update1=~chomp; my @update2=split /#/,$update1;# this bit works But I still get a b

Re: reading shell variables [Was all confused about a hash]

2004-02-21 Thread Kenton Brede
On Sun, Feb 22, 2004 at 12:30:14AM +, RichT ([EMAIL PROTECTED]) wrote: > My next question is, how can i read in variables from the shell? > > im using Solaris / ksh You can access environment variables though the %ENV hash. I've listed a couple standard ways to do so below. If you are c

reading shell variables [Was all confused about a hash]

2004-02-21 Thread RichT
> >>Use of uninitialized value at ./poller.cfg.search.pl line 22, chunk 5. >> which is happening on the last line of each section which is "[TAB] } \n" or after >> i have " s/["}{]//g; " i guess it would be "[TAB] /n" >>how can ignore this last line? Ok i figgered it out... the problem was th

Re: all confused about a hash

2004-02-21 Thread RichT
At 20:34 21/02/2004, you wrote: >At 14:01 21/02/2004, you wrote: > >>Hi. > >Hello again and thank you > >>I recently questioned whether a rewrite was an appropriate response >>to a question on this group. Now I'm going to do it anyway! > >after seeing you code i have cleaned up mine, >amassing how

Re: all confused about a hash

2004-02-21 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Hi all, > > I am searching through a large data file and pulling out the data for > elements that match the IP address... > this is at least half working well up to " #just for testing 1" > but not after " #just for testing 2", hash %seg

Re: all confused about a hash

2004-02-21 Thread RichT
At 14:01 21/02/2004, you wrote: >Hi. Hello again and thank you >I recently questioned whether a rewrite was an appropriate response >to a question on this group. Now I'm going to do it anyway! after seeing you code i have cleaned up mine, amassing how much eazy'er it make it to read. >First

Re: all confused about a hash

2004-02-21 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > I am searching through a large data file and pulling out the data for > elements that match the IP address... > > this is at least half working well up to " #just for testing 1" > but not after " #just for testing 2", hash %segmentFields is > not being populated. > >

all confused about a hash

2004-02-20 Thread DrOwl
Hi all, I am searching through a large data file and pulling out the data for elements that match the IP address... this is at least half working well up to " #just for testing 1" but not after " #just for testing 2", hash %segmentFields is not being populated.

Re: While loop, confused... - Thanks!

2003-07-03 Thread Bill Akins
Thank you all for your responses!! I finally have a handle on it and used a little of everyones suggestions. This list rocks because of people like you. Thanks again!

Re: While loop, confused...

2003-07-03 Thread Rob Anderson
Hi Bill, I know you've had lots of comments on this, but I thought I'd throw my own style in. Why not do your check at the bottom with a "do until"? First time round the check is useless anyway, and will give you 'undef' type warnings with perl -w. It also allows you to be more positive in your co

RE: While loop, confused...

2003-07-02 Thread Shishir K. Singh
>Hi all! >I have this while loop in my script: >while (($type ne "Windows") || ($type ne "Linux")) { >print "Enter TYPE of server to build. Linux or Windoze [linux, windows]:\n"; >$type = ; >chomp $type; >$type =~ tr/a-z/A-Z/; >if (($type eq "LINUX") || ($type eq "L")) { >$type = "Linux"; } >i

RE: While loop, confused...

2003-07-02 Thread Charles K. Clarkson
Bill Akins <[EMAIL PROTECTED]> wrote: : : while (($type ne "Windows") || ($type ne "Linux")) { This will always be true. Try: while ( $type ne 'Windows' && $type ne 'Linux' ) { ^^ HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc.

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
Sorry... In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > > >> Here's an 'or' version: >> my $type1 = ''; >> while ( $type1 !~ /wisteria|lime/i ) { >>print "Enter COLOR of server. Lime or Wisteria [lime, wisteria]: "; >>chom

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > Here's an 'or' version: > my $type1 = ''; > while ( $type1 !~ /wisteria|lime/i ) { >print "Enter COLOR of server. Lime or Wisteria [lime, wisteria]: "; >chomp( $type1 = ucfirst lc ); >$type1 = 'Wisteria' if $type1 eq 'W'; >$

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, John W. Krahn wrote: > Bill Akins wrote: >> >> Hi all! > > Hello, > >> I have this while loop in my script: >> >> while (($type ne "Windows") || ($type ne "Linux")) { > > Your problem is that you are using or when you should be using and. > > >> print "Enter

RE: While loop, confused...

2003-07-02 Thread Bill Akins
> > while (($type ne "Windows") || ($type ne "Linux")) { > Right here, you must have the full string "Windows" or "Linux" Yes, correct. > > print "Enter TYPE of server to build. Linux or Windoze > > [linux, windows]: > > \n"; > > $type = ; > > chomp $type; > > $type =~ tr/a-z/A-Z/; > > Here yo

Re: While loop, confused...

2003-07-02 Thread John W. Krahn
Bill Akins wrote: > > Hi all! Hello, > I have this while loop in my script: > > while (($type ne "Windows") || ($type ne "Linux")) { Your problem is that you are using or when you should be using and. > print "Enter TYPE of server to build. Linux or Windoze [linux, windows]: > \n"; > $type =

RE: While loop, confused...

2003-07-02 Thread LoBue, Mark
> -Original Message- > From: Bill Akins [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 02, 2003 3:48 PM > To: [EMAIL PROTECTED] > Subject: While loop, confused... > > > Hi all! > > I have this while loop in my script: > > while (($type ne "

While loop, confused...

2003-07-02 Thread Bill Akins
Hi all! I have this while loop in my script: while (($type ne "Windows") || ($type ne "Linux")) { print "Enter TYPE of server to build. Linux or Windoze [linux, windows]: \n"; $type = ; chomp $type; $type =~ tr/a-z/A-Z/; if (($type eq "LINUX") || ($type eq "L")) { $type = "Linux"; } if (($type

Re: Confused on hash references

2003-02-13 Thread Lance
Check out Data::Dumper, you'll love it! www.perldoc.com Pass it a ref and it prints out a pretty data structure recursively, so you don't have to! Ain't Perl Grand? "Barry Kingsbury" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have created the following

Re: Confused on hash references

2003-02-13 Thread Jeff 'japhy' Pinyan
On Feb 13, Barry Kingsbury said: >I have created the following data structure: > >%mailings = ( tv => { mail_demo_key => "Demo License Key for TotalView", > mail_thank_you => "Thank you for downloading >TotalView", > pdf => LOCATION_OF_PDF,

RE: Confused on hash references

2003-02-13 Thread wiggins
On Thu, 13 Feb 2003 09:21:13 -0500, Barry Kingsbury <[EMAIL PROTECTED]> wrote: > Can some guru explain? > They have already ;-)...have you done your reading? perldoc perlreftut perldoc perlref These are two excellent starting places, and shoul

Confused on hash references

2003-02-13 Thread Barry Kingsbury
I have created the following data structure: %mailings = ( tv => { mail_demo_key => "Demo License Key for TotalView", mail_thank_you => "Thank you for downloading TotalView", pdf => LOCATION_OF_PDF, location=> L

Re: confused with File::Glob

2003-02-09 Thread Rob Dixon
Harry Putnam wrote: > "John W. Krahn" <[EMAIL PROTECTED]> writes: >>> >>> use File::Glob ':glob'; >>^^^ >> Note that the only options available are ':case', ':nocase' and >> ':globally', > > Maybe it recognizes the abbrev or something. Doesn't seem to be > wreaking havoc a

Re: confused with File::Glob

2003-02-09 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: >> cat ./testglob.pl >> #!/usr/local/bin/perl -w >> >> use File::Glob ':glob'; >^^^ > Note that the only options available are ':case', ':nocase' and > ':globally', Maybe it recognizes the abbrev or something. Doesn't seem t

Re: confused with File::Glob

2003-02-08 Thread John W. Krahn
Harry Putnam wrote: > > Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: > > > And || enforces scalar context, so func() won't (can't) return a list, in > > your case. > > Thanks, I'd have been a very long time figuring that out... Another point. > cat ./testglob.pl > #!/usr/local/bin/perl -w

Re: confused with File::Glob

2003-02-08 Thread Harry Putnam
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: > And || enforces scalar context, so func() won't (can't) return a list, in > your case. Thanks, I'd have been a very long time figuring that out... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: confused with File::Glob

2003-02-08 Thread Jeff 'japhy' Pinyan
On Feb 8, Harry Putnam said: > @files = bsd_glob("$glob_pattern",GLOB_ERR)|| die "Yikes: $!"; This line screws you up. Change the || to 'or'. @files = bsd_glob(...) or die "Yikes: $!"; The reason being: || binds very tightly, and 'or' binds less tightly. With ||, your code is like @file

confused with File::Glob

2003-02-08 Thread Harry Putnam
Apparently I'm not getting what it is that File::Glob is supposed to do: ls tmp/file_[0-9]*|wc -l 99 All 99 look like tmp/file_NUM with incrementing number. Why doesn't this code unwind the list of files? when this command is given: ./testglob.pl 'tmp/file_[0-9]*' cat ./testglob.pl #!/us

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
ine, the @ is followed by a parenthesis while the comma is > preceded by a curly bracket. I presumed they both should have been > parentheses. When I try it, I get: > syntax error at c:\INDIGO~1\HTDOCS\CREW\CALENDAR.CGI line 244, near > "@($trainsList" > syntax error at c:\INDI

Re: Confused by a complex data structure

2002-12-15 Thread Rob Richardson
e been parentheses. When I try it, I get: syntax error at c:\INDIGO~1\HTDOCS\CREW\CALENDAR.CGI line 244, near "@($trainsList" syntax error at c:\INDIGO~1\HTDOCS\CREW\CALENDAR.CGI line 259, near "}" I have no idea why this construct should cause Perl to be confused about the clo

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
Rob Richardson wrote: > > Greetings! Hello, > I am trying to write a Perl script for the Cuyahoga Valley Scenic > Railroad, so that volunteers can sign up to work on trains. The > schedule file has comma-separated lines that have the date of the > train, the name of the train, and the names of

RE: Confused by a complex data structure

2002-12-14 Thread Beau E. Cox
Hi - Tell perl it really is an array: push @( $trainsList{$trainDate} }, $trainRef; ^^ ^ Aloha => Beau. -Original Message- From: Rob Richardson [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 3:35 PM To: [EMAIL PROTECTED] Subject: Confu

Confused by a complex data structure

2002-12-14 Thread Rob Richardson
Greetings! I am trying to write a Perl script for the Cuyahoga Valley Scenic Railroad, so that volunteers can sign up to work on trains. The schedule file has comma-separated lines that have the date of the train, the name of the train, and the names of people who will be working on the train (or

Re: very confused - chdir not working

2002-10-13 Thread Michael Fowler
On Fri, Oct 11, 2002 at 04:40:30PM +0100, mike wrote: > ../build.pl > /root/cvs/esound # this the output of $dir3 > / > > cannot change No such file or directory at ./build.pl line 13, > line 55. > this is ls in same directory, as you can see esound is there I don't have any context for what th

Re: very confused - chdir not working

2002-10-12 Thread mike
On Fri, 2002-10-11 at 23:08, Michael Fowler wrote: > On Fri, Oct 11, 2002 at 04:40:30PM +0100, mike wrote: > > ../build.pl > > /root/cvs/esound # this the output of $dir3 > > / > > > > cannot change No such file or directory at ./build.pl line 13, > > line 55. > > this is ls in same directory, a

Re: very confused - chdir not working

2002-10-11 Thread Larry Coffin
At 11:40 AM -0400 10/11/02, mike wrote: >../build.pl >/root/cvs/esound # this the output of $dir3 >/ Is your output of 'print "$dir3\n"' : /root/cvs/esound / Or just: /root/cvs/esound From your code, I suspect the former since $dir3 is supposed to end with a "/"

Re: very confused - chdir not working

2002-10-11 Thread mike
On Fri, 2002-10-11 at 09:14, Michael Fowler wrote: > On Fri, Oct 11, 2002 at 06:50:00AM +0100, mike wrote: > > On Fri, 2002-10-11 at 05:36, Michael Fowler wrote: > > > On Fri, Oct 11, 2002 at 04:16:41AM +0100, mike wrote: > > > > Unfortunatel chdir does not work > > > > > > In what way doesn't it

Re: very confused - chdir not working

2002-10-11 Thread Michael Fowler
On Fri, Oct 11, 2002 at 06:50:00AM +0100, mike wrote: > On Fri, 2002-10-11 at 05:36, Michael Fowler wrote: > > On Fri, Oct 11, 2002 at 04:16:41AM +0100, mike wrote: > > > Unfortunatel chdir does not work > > > > In what way doesn't it work? Are you getting an error? How are you > > verifying it

Re: very confused - chdir not working

2002-10-10 Thread Steve Grazzini
Mike <[EMAIL PROTECTED]> wrote: > On Fri, 2002-10-11 at 05:36, Michael Fowler wrote: >> On Fri, Oct 11, 2002 at 04:16:41AM +0100, mike wrote: >> > Unfortunatel chdir does not work >> >> In what way doesn't it work? Are you getting an error? How >> are you verifying it doesn't work? > > no err

Re: very confused - chdir not working

2002-10-10 Thread mike
On Fri, 2002-10-11 at 05:36, Michael Fowler wrote: > On Fri, Oct 11, 2002 at 04:16:41AM +0100, mike wrote: > > Unfortunatel chdir does not work > > In what way doesn't it work? Are you getting an error? How are you > verifying it doesn't work? no errors but directory does not change with use s

Re: very confused - chdir not working

2002-10-10 Thread Michael Fowler
On Fri, Oct 11, 2002 at 04:16:41AM +0100, mike wrote: > Unfortunatel chdir does not work In what way doesn't it work? Are you getting an error? How are you verifying it doesn't work? > This is the script > > #!/usr/bin/perl -ww > open(BLD_LIST,"buildlist"); > my @pkg=; > my $ver=$ARGV[2]; >

very confused - chdir not working

2002-10-10 Thread mike
Hi I am building the following script to recurse back and forth down a directory tree Unfortunatel chdir does not work This is the script #!/usr/bin/perl -ww open(BLD_LIST,"buildlist"); my @pkg=; my $ver=$ARGV[2]; my $name=$ARGV[0]; my $release=$ARGV[1]; foreach my $pkg (@pkg){ my $dir1=$pkg;

I am confused with looping to stop repeat accurances of a entryies ina log for a report

2002-09-03 Thread FLAHERTY, JIM-CONT
I am trying to parse a squid log file to let It management know where people are browsing too. my plan block diagram goes a follows 1. open log 2. seperate by IP address , list only one at a time no repeats of the same IP address 3. list only one instance of a visited site , per IP address 4

Re: confused about perl and jpg

2002-03-28 Thread Wytch
"Agustin Rivera" <[EMAIL PROTECTED]> wrote in message 002201c1d6a9$4e8cec40$9865fea9@agustinr">news:002201c1d6a9$4e8cec40$9865fea9@agustinr... > You're right. I was thinking when I deemed a > valid tag. lol.. I guessed that was the case and felt a bit guilty after pressing the send button...

Re: confused about perl and jpg

2002-03-28 Thread Agustin Rivera
You're right. I was thinking when I deemed a valid tag. "Agustin Rivera" <[EMAIL PROTECTED]> wrote in message 000d01c1d6a3$f7e83c50$9865fea9@agustinr">news:000d01c1d6a3$f7e83c50$9865fea9@agustinr... > Your html tag is misformatted for starters. > > try > > print " "; > or > print " "; > > I h

Re: confused about perl and jpg

2002-03-28 Thread Wytch
"Agustin Rivera" <[EMAIL PROTECTED]> wrote in message 000d01c1d6a3$f7e83c50$9865fea9@agustinr">news:000d01c1d6a3$f7e83c50$9865fea9@agustinr... > Your html tag is misformatted for starters. > > try > > print " "; > or > print " "; > > I have no idea if the image is actually there, however :) Actu

Re: confused about perl and jpg

2002-03-28 Thread Agustin Rivera
EMAIL PROTECTED]> To: "begginners" <[EMAIL PROTECTED]> Sent: Thursday, March 28, 2002 1:40 PM Subject: confused about perl and jpg > Hi!, > > I am trying to display an jpg image: > > print ""; > > But it tells me that the file is not foun

confused about perl and jpg

2002-03-28 Thread Jerry Preston
Hi!, I am trying to display an jpg image: print ""; But it tells me that the file is not found? What am I missing? Thanks, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: confused over cookbook example 6-2

2001-08-10 Thread Bob Showalter
> -Original Message- > From: Cohan, Drew [mailto:[EMAIL PROTECTED]] > Sent: Friday, August 10, 2001 8:32 AM > To: '[EMAIL PROTECTED]' > Subject: confused over cookbook example 6-2 > > > I'm trying to modify cookbook example 6-2: > >

Re: confused over cookbook example 6-2

2001-08-10 Thread Jos I. Boumans
are you sure your input is what you expect it to be? maybe print out all the lines? and if you like, i wrote a very basic and simple html parser. you can get it here: http://japh.nu/index.cgi?base=modules take a look at the source, it should probably explain a lot hth Jos > I'm trying to modi

confused over cookbook example 6-2

2001-08-10 Thread Cohan, Drew
I'm trying to modify cookbook example 6-2: #killtags: very bad html tag killer undef $/; while(<>){ s/<.*?>//gs; print; } to instead look for all "href=" in an html file across paragraphs/newlines but I only get the first successful match. why does the cookbook's work but not mi

  1   2   >