Re: directory listing to array

2001-06-07 Thread Shawn
Holy JESUS! Why not: opendir DIR, $directory or die "can't open $directory: $!\n"; @files = grep /jpg$/i, readdir DIR; On 06/07, John Storms rearranged the electrons to read: > my($path) = "/home/jstorms/public_html/images/"; > my(@files) = get_jpg_from_dir($path); > > sub get_jpg_from_dir { >

Re: directory listing to array

2001-06-07 Thread Shawn
Emerson rearranged the electrons to read: > ...and just to include both .jpg and .jpeg like John's program: > > opendir DIR, "./" or die "can't open $directory: $!\n"; > @files = grep /jpe?g$/i, readdir DIR; > > Nice code, Shawn. I must admit t

Re: More "Succinctification"

2001-06-07 Thread Shawn
ITakeItTheyDidNotWantToUseWhitespace? On 06/07, Teresa Raymond rearranged the electrons to read: > How can we make this code more succinct? > > #LOOP TO INITIALIZE VARIABLES + TEST N COMMANDS FOR MATCH IS YES > foreach $i (sort(@indata)) > {chop($i); > ($aptname,$address,$city,$zip,$phone,$locat

PERL module: Help please!

2001-06-08 Thread Shawn
I will start by saying this is largely a learning excersize. I want to get to the point where I can write a PERL module using some C code in the backend. I would be greatful as hell for any help on this! I don't know if this makes enough sense to grok, but here goes: I want the module to use com

Re: PERL module: Help please!

2001-06-08 Thread Shawn
My appologies for the bad grammer... ;) On 06/08, Shawn rearranged the electrons to read: > I will start by saying this is largely a learning excersize. I want to > get to the point where I can write a PERL module using some C code in > the backend. I would be greatful as hell for an

Question on optimizing this sub (help!)

2001-05-01 Thread Shawn
Can someone look at a subroutine for me? Specifically, after this (at bottom of email) subroutine runs, it increases my RSS by 6 megs, and shouldn't do that. (here it has indexed 133798 files) This is the program before the checkstuff subroutine runs: PID USER PRI NI SIZE RSS SHARE STAT

mv'ing a file from within perl (w/out /bin/mv)

2001-05-09 Thread Shawn
I just want an efficient mv subroutine or module which has such a thing, but none of the File::* things seem to have mv. I would rather not shell out 1 times just to, in the vast majority of cases, move a file from on dir to another in the same fs. Can someone help? -- Hob Goblin [EMAIL PRO

Fastest way to [l]stat every file in a dir

2001-05-11 Thread Shawn
So, I have th is function called lookat(). It basically puts selected stat data of files into a hash of hashes (%dirs) as you can see. Is there any better way to gather a bunch of files' stat data than looping and calling lstat? Recent profiling of my code (props to Jeff Pinyan for some awesome

Re: matching question (real newbie...not like you fake newbies out there...)

2001-05-17 Thread Shawn
/edi$/i I think? On 05/17, John Joseph Trammell rearranged the electrons to read: > On Thu, May 17, 2001 at 09:25:53PM -, Stout, Joel R wrote: > > if (/edi\b/i) { # thinking I would match file names 1, 2, and 4. Instead I > > matched on all. Wasn't \b supposed to help me out here? Or does

REVIEW: judfr.pl (file indexer/ dup remover)

2001-05-18 Thread Shawn
1st of all, thanks VERY much to Jeff P for the excellent review of version 0.4 of my script. I am nearing 0.8, and would like a critique of this code. This script, when given a dir as an arg, will index all files in that dir recursively, placing a .didx text file in dirs, containing md5sum, devic

Re: REVIEW: judfr.pl (file indexer/ dup remover)

2001-05-21 Thread Shawn
I thought it was great to send your stuff to the list to get reviewed? Sorry I tried. On 05/18, Shawn rearranged the electrons to read: > 1st of all, thanks VERY much to Jeff P for the excellent review of > version 0.4 of my script. I am nearing 0.8, and would like a critique of >

Re: a beginners challenge

2001-11-30 Thread Shawn
> @result= `find . -newerct \'3 days ago\' -maxdepth 1 -exec rm \{\} \\;`; I guess I have to ask, what is this command? -newerct? I get the following when running this line: find: -newerct: unknown option Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: Reading files into arrays

2001-11-30 Thread Shawn
ount=0; my @array; open(F,") { chomp $line; $count++ if($line=~/\w+\|/); $array[$count].=$line; } close(F); print $_,"\n" for(@array); Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Urgent! creating new hash from hash based on format of another hash

2001-12-02 Thread Shawn
em}; } $newhash{$_}{'num_items'}=$item_count; } foreach(sort keys %newhash) { print "Hash Set: $_\n"; foreach my $item (sort keys %{$newhash{$_}}) { print " Name: $item Value: $newhash{$_}{$item}\n"; } } Shawn - Original Message - From: "

Re: $searchstring help

2001-12-07 Thread Shawn
e pattern. He didn't specify it > had to start with a letter or number, he said it needs to be in the string. > > $searchstring =~ /[a-z0-9]/i; Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: $searchstring help

2001-12-07 Thread Shawn
- Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 07, 2001 5:55 PM Subject: Re: $searchstring help > Shawn wrote: > > > > > On Fri, Dec 07, 2001 at 04:35:11PM -0500, Maurice Reeves wrot

Re: beginner question

2001-12-13 Thread Shawn
is beiing treated like an array DB_File is a module that you are going to use some functionality from. O_RDWR is to state that you want read/write access to this file |O_CREAT is to state that if the file does not exist to create it 0666 is to set the permissions of the created file $DB_RECNO - I don't know yet, I have not used DB_File before but my guess would be that this is the data that will be written to the newly created file. Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Cant run CGI Scripts?

2001-12-18 Thread Shawn
ut no matter what, you will need a web server of some sort before you can view your scripts in a browser. As far as 192.168.xxx.xxx, it is my understanding that this address range is really used customarily for LAN/intranet use, and not 'net' use (but I could be wrong...) Shawn - O

Re: Some split help here please

2001-12-18 Thread Shawn
tting the split right. > I have > My ($wday,$month,$mday,$year) = split (/ /); > I know this is wrong seeing that I have more than > One space between the month and the day of the month. > > Could someone lend a hand to get this split correct? > > Regards, > Ron Hey Ro

Re: directing output

2001-12-19 Thread Shawn
Hey Aaron, I am not familiar with the 'who' command, but you can probably do this: #!/usr/bin/perl -w use strict; open(IN, 'who | '); my @array=; close(IN); open(FILE,'>file.txt') or die "Can't write file.txt: $!\n"; print FILE @array; cl

Re: Replace

2001-12-19 Thread Shawn
I think this is what you are asking for... $string=s/(\w+)_(NN|IN|AT)/$1/g; $string=''.$string.''; Shawn - Original Message - From: "RNOORY" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 1:32 PM Subject: Replac

Re: Learning Perl, chapter 8: pattern_test

2001-12-19 Thread Shawn
n with a > screwdriver. "I would have never tried that, actually, and it looks > durn inefficient. Maybe you should stop doing that." ROFLMAO Thanks for that bright spot in the day Randal :-) Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Macintosh

2001-12-19 Thread Shawn
Hey PC, Need a bit more to go on. Assuming that you mean Perl for 'program', what 'indicated file'? Shawn > Hi, > > On the Macintosh, I cannot get the program to open the indicated file for > processing. Please help. -- To unsubscribe, e-mail: [EMAIL PROTE

Re: Replace

2001-12-20 Thread Shawn
> Shawn wrote: > > > > I think this is what you are asking for... > > > > $string=s/(\w+)_(NN|IN|AT)/$1/g; > > $string=''.$string.''; > > > > Shawn > > I believe, there's a typo :-) > $string =~ s/(\w+)_(NN|IN|AT)

Re: Cant figure out how key's value in a hash is created in program example.............

2001-12-20 Thread Shawn
x27;); for $word (@words) { $count{$word}=$count{$word}+1; # same as $count{$word}++; } will give you: $count{'test'} = 2 $count{'this'} = 1 $count{'that'} = 1 Shawn > foreach $word (@words){ # for every element of the array @words.. > $co

Re: I need your help

2001-12-20 Thread Shawn
lete the word from the second problem, just remove the REPLACEMENT_WORD completely (replace with nothing). Shawn - Original Message - From: "Jose Vicente" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 20, 2001 10:30 AM Subject: I need your help

Re: resetting foreach loops and @lists

2001-12-21 Thread Shawn
gt; ... > > > last if ($hash{city} eq $hash2{city}); > > > > Bare words as hash keys. > > And that's a problem how? It's a big problem when using 'strict'... Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: resetting foreach loops and @lists

2001-12-21 Thread Shawn
ot of spaces in my hashes... never thought about it... I stand corrected... Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: resetting foreach loops and @lists

2001-12-21 Thread Shawn
no problem', 'your two' => 'still no problem' ); print $test_hash{ 'my one' }; # prints 'no problem' (without quotes) ^^^ Correct My hashes are generally a bit more descriptive than 'one'... Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: resetting foreach loops and @lists

2001-12-21 Thread Shawn
in the butt because of it. Since I use long hash keys a lot, I have gotten into the practice of always quoting my keys and values. So, I made a mistake in my statement. Again, I stand corrected on the hash key needing to be quoted. > > Shawn, I mean no offense by any of this. These could merely

Re: Question for those using gd.pm

2002-01-02 Thread Shawn
Hey Joel, Here is a script I made a couple of years back where I DID use another font... Shawn #!perl -w use GD; use GD::Text::Wrap; &make_message; exit; sub make_message { open(PNG,"button.png") or die print "Can't open button.png: $!\n"; $map=newFromPn

Re: find blank line

2002-01-02 Thread Shawn
Hey Tim, This will check for lines that have nothing but white space in them and skip them. White space includes newlines as well... Shawn open(F,'file.txt'); while() { next if(/^\s*$/); blah... } close(F); - Original Message - From: "Booher Timothy B 1stLt AFR

Re: remove spaces before and after (thanks)

2002-01-03 Thread Shawn
Hey Jeff, Off the of your head, do you have any idea how much '$line=$_' slows the script down since you are now performing 2 separate regex's? Or does it in fact speed it up? Shawn > while () { > $line = $_; > next if $line =~ (/foo/) | (/bar/); >

Re: cycle through buffer

2002-01-03 Thread Shawn
x27;t you just want to iterate over the lines as you are reading it? Shawn > Why can't I do something like this? Load everything to a buffer then cycle > through the buffer? > > #!/usr/bin/perl -w > open(MYFILE,'test2.txt'); > while () { > $buffer .= $_;

Re: question -- beginner's programmer's block (your answer)

2002-01-03 Thread Shawn
Would this not work for you? This way you would only have a portion of the file in memory... Shawn # UNTESTED use strict; open(FILE,'some_file.txt') or die "Can't open some_file.txt: $!\n"; my $state = 0; my $buffer = "; while () { $buffer.=$_; if (/^\

Re: Using regexp to get a substring

2002-01-06 Thread Shawn
ngTest.pl", how do I use regexp to parse > this string and get substring after the last backslash ("StringTest.pl"). Hey David, This should work for you: use strict; my $String='C:\PerlScripts\TestSamples\StringTest.pl'; (my $substring =$string) =~s/.*\\(.*)/$1/; Shawn

Re: more help!!!trying to match password

2002-01-19 Thread Shawn
check for a-z, A-Z, 1-0 ??? >## > >is there a better way? How about: $password=~s/@|\./_/g; $password=~s/\W/-/g; Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Re:What's wrong with this?

2002-01-24 Thread Shawn
Perl is case sensitive... You have 'Open' instead of 'open'. It wants you to define the 'Open' subroutine, but I don't think that is what you want :-) Shawn - Original Message - From: "Jorge Goncalvez" <[EMAIL PROTECTED]> To: <[E

Re: Re:What's wrong with this?

2002-01-24 Thread Shawn
This is just a guess (not even sure if you can create a hash [%rkey] like this...), but give it a try. CPAN states that this module is obsolete and to use Win32:TieRegistry instead... Shawn use strict; use Win32::Registry; my $Register ="Software"; my $Register2=&quo

Re: Trying to use strict

2002-01-24 Thread Shawn
@var=@_; #This is where you pass your array... @var=sort @var; return(@var); } sub end { my($var1,$var2,$var3)=@_; print $var1,$var2,$var3; } Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What's the different between -> and => ?

2002-01-27 Thread Shawn
for de-referencing: my %hash=('35'=>'Bob','Chlorine'=>'Blah'); my $ref = \%hash; foreach(keys %{$ref}) { print "Key: $_ Value: $ref->{$_}\n"; } See perldoc's perlreftut and perldata...

Re: What's the different between -> and => ?

2002-01-27 Thread Shawn
- Original Message - From: "Shawn" <[EMAIL PROTECTED]> To: "Connie Chan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, January 27, 2002 3:00 AM Subject: Re: What's the different between -> and => ? > The big arrow is used

Re: decimal point

2002-01-27 Thread Shawn
use strict; my $var=4536233; my $new_var=$var/100; print $new_var; Shawn - Original Message - From: "Stuart Clark" <[EMAIL PROTECTED]> To: "Perl List" <[EMAIL PROTECTED]> Sent: Sunday, January 27, 2002 7:56 PM Subject: decimal point > Hi, > I

Re: wildcard for unix????

2002-02-03 Thread Shawn
I believe you can do it with just chmod 755 *... Shawn - Original Message - From: "Luinrandir Hernson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, February 03, 2002 2:54 PM Subject: wildcard for unix What is the g

Regex question about '\b'

2002-02-05 Thread Shawn
Hello all, In a regex, the '\b' can stand for: 1) a boundry between a word and non-word char 2) bakcspace What is the precedence for figuring out which is being called? TIA, Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: nonzero $! value after closing a pipe normally

2002-02-06 Thread Shawn
hen have the die or exit in the pr_my_error_routine... or my $status=open MYPROFILE, "cat mytxtfile |"; unless($status) { pr_my_error_routine “close error in MYPROFILE with $!\n”; } You can't rely on $! not to be holding an 'error' already that you haven't

Re: Difference between == and eq

2002-02-06 Thread Shawn
s a numeric compare 1 == 1 eq is a stringwise compare a eq a see perlop for more... Shawn > > When I do: > > if ( $menuitem == "modify_router") { > print "Modify router"; > } else { > print "Add router"; > } > > it

Re: Sorting an array of hashes

2002-02-06 Thread Shawn
, Status => 1 } > ); > I think this will do what you are looking for... use strict; my @AoH = ( { ID => 10101, UserID => 1041, Status => 2 }, { ID => 10541, UserID => 1211, Status => 1 }, { ID => 10111, UserID => 1211, Status => 2 }, { ID => 107

Re: Construct Question

2002-02-06 Thread Shawn
s: > > > > open(REGION_NAME, " > while($region = ) { > print "$region"; > } > > close(REGION_NAME); > > I get no errors with the following. I don't see much difference except for strict and scoping... use strict; open(REGION_NAME,

Re: Construct Question

2002-02-06 Thread Shawn
g that the file would close upon exit). Would there be an error if you tried to open the filehandle a second time if it had not closed? Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Adding drop-in modules to a program

2004-06-11 Thread Shawn
different ways of doing this but I was wondering if there was a recommended way or "elegant" way of doing it... Thanks in advance! Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Using a CGI form for editing a freeform hash structure

2004-07-20 Thread Shawn
My holy grail for right now is to be able, from a CGI form, allow someone to: 1. display a hash of both key/value pairs, hashes, or arrays, fully expanded 2. be able to edit key/value pairs in the structure through the CGI form 3. add or delete key/value pairs, or empty sub-hashes Even a pretty d

Re: Using a CGI form for editing a freeform hash structure

2004-07-20 Thread Shawn
On Tue, 2004-07-20 at 18:47 -0700, Randal L. Schwartz wrote: > >>>>> "Shawn" == Shawn <[EMAIL PROTECTED]> writes: > > Shawn> 1. display a hash of both key/value pairs, hashes, or arrays, fully > Shawn> expanded > Shawn> 2. be able to edi

Re: Could this be made shorter and cleaner?

2004-08-31 Thread Shawn
On Tue, 2004-08-31 at 10:57 -0400, Daniel Staal wrote: > --As of Tuesday, August 31, 2004 10:07 AM +0100, Gavin Henry is alleged to > have said: > > > P.S. I am now a programmer or a scripter, I am not sure is perl is > > programming or scripting? I think programming. > > --As for the rest, it i

Time conversion question

2002-02-12 Thread Shawn
How might I convert a date/time string to epoch seconds? For example, taking "02/05/2002 02:31:14" and convert to epoch seconds. -- Shawn Leas [EMAIL PROTECTED] I have a switch in my apartment... it doesn't do anything Every once in a while, I turn it on and off One d

Re: Time conversion question

2002-02-12 Thread Shawn
, 12 Feb 2002 17:03:00 -0600, Shawn <[EMAIL PROTECTED]> wrote: > > How might I convert a date/time string to epoch seconds? > > > > For example, taking "02/05/2002 02:31:14" and convert to epoch seconds. > > One easy way to do it is to use the standard Tim

Re: reading one character at a time

2002-03-04 Thread Shawn
tionality inside the for loop since $char will be re-written by $_ on every pass. Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to read hdlist and company

2002-03-18 Thread Shawn
I would like to be able to read hdlist. I use my own RPM updater, and I'd like to start doing things the right way. -- Shawn Leas [EMAIL PROTECTED] I saw a subliminal advertising executive, but only for a second. -- Stephen Wright -

Large hash keys & hash performance

2002-03-26 Thread Shawn
like grep /pattern/, keys %hash) key lookups (referencing $hash{$key}) What are the key factors in /good performing/ hash keys? Thank you for your input. -- Shawn Leas [EMAIL PROTECTED] I used to work in a fire hydrant factory. You couldn't park anywhere near the

Re: CPAN?

2002-04-25 Thread Shawn
ite the 'callback' function > > eg: sub wants { ... } > > to do the majik you want it to do The thing to do here might be to play with find2perl and look at its output given various options. Try executing find2perl / -name "*.txt" -print The exec option makes th

Re: Serious problem with perl -pi -e

2002-04-30 Thread Shawn
> > $ cat foo > > foo > > $ perl -pi -e 's/o/e/' foo > > $ cat foo > > feo > > $ chmod 000 foo > > $ cat foo > > cat: foo: Permission denied > > $ perl -pi -e 's/o/e/' foo > > Can't open foo: Permission denied.

[OT] Re: Serious problem with perl -pi -e

2002-05-06 Thread Shawn
the system level, so you might as well do it and fix what you can. On 05/06, Sharan Hiremath said something like: > Thanks a log Shawn, > > But setting of this variable, now (after installation), will it be helpful. > > Thanks and Regards > Sharan Hiremath. > -- Shawn Leas [EMAIL

Re: Perl Cookbook

2002-05-15 Thread Shawn
f you are an expert, it most likely has many things to teach you still. I wouldn't recommend buying from Amazon though, I have found bookpool always to been cheaper (http://www.bookpool.com/.x/kgyc9h3l4n/ss/1?qs=1565922433). Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: Shredding a file

2002-05-28 Thread Shawn
<22?${'y'.$_}=chr$.+64:[$$=${'y' > !|.q| ,@$@&.,. $$$&, ..@&&$,,, $., ..!.$_},$y.=($.=~/22\|26\|3(3\|7)/x?' ' > !|.q|. @ ., ,.&,,, , .$..&. .,$ .,,!.$$:"\l$$")]};$y=~/ (.*)/;warn"$1\n" > !|.q|. $ .,. .,$$&&$...&., @.,.&@$@ .|,map{-$|--?$r:$p.=

Re: Shredding a file

2002-05-28 Thread Shawn
g your > memory image. > > > HTH & HAND > > :-D > -- > David T-G * It's easier to fight for one's principles > (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie > (work) [EMAIL PROTECTED] > http://www.justpickone.

Re: Shredding a file

2002-05-28 Thread Shawn
t processor for billing) > without thereby having it in plaintext (either in memory or somewhere else)? Well, if the merchant has his own cipher key, it can all be encrypted with the owner's cipher key. That make sense? This protects the data from customer to customer, and there is no need at al

Re: Shredding a file

2002-05-28 Thread Shawn
On 05/28, Shawn said something like: > On 05/28, David T-G said something like: > > % sort of secure form in memory (encrypted or something). > > > > Now that's an interesting one... Suppose someone feeds this script a > > password or a credit card number or suc

Re: Launching Perl Code in Parallel

2002-05-30 Thread Shawn
e_cream_descriptions.pl accept different number ranges and launch > > itself. > > I have been looking at the fork() command. > > I believe fork() only creates a copy of the original process but I wasn't > > quite sure how I could pass the different number ranges into

Re: split

2002-06-04 Thread Shawn
Hello stefan, You will need just a basic regex, not a split my $string='# FRI MAY 02'; $string=/(.*?)\s+(.*)/; my $bash=$1; my $rest=$2; Shawn - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 04, 2002 6:49 AM Su

Re: Size of dir (with recursion)

2003-12-29 Thread Shawn
While you're at it, write a parallel version of du.pl... Modern hard drives do scatter gather, and reading lots (say 10 or so) of dirs' contents' block sizes at a time would be interesting... It would be cool if a parent kept 20 children pre-forked, and only told 10 children at a time to do their

Re: A very, very simple question

2002-10-31 Thread Shawn
On 10/31, Gajo Csaba said something like: > I've started learning Perl a few days ago, but I'm a > computer science student, so I'm not a complete idiot > :) Do you really want to "sub print"? > sub print > { > etc... -- Shawn Leas [EMAIL PROTECTED]

Matching vogon

2003-02-26 Thread Shawn
I have an issue with this snipppet: if ($file =~ /^${name}(.*)${suf}$/) { ...and that is, that the $name variable can end in a couple "+" chars, or some other special characters. This results in: Nested quantifiers in regex; marked by <-- HERE in m/^libsigc++ <-- HERE (.*).tar.bz2$/ at /03d

Re: Matching vogon

2003-02-26 Thread Shawn
I KNEW I saw this in the list before, but didn't quite know how to search for it. Thanks! On Wed, 2003-02-26 at 18:51, Casey West wrote: > It was Wednesday, February 26, 2003 when Shawn took the soap box, saying: > : I have an issue with this snipppet: > : if ($file =~ /^${

Re: Search engines and SSI

2002-06-07 Thread Shawn
owser. Shawn - Original Message - From: "Troy May" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Saturday, May 25, 2002 12:04 AM Subject: Search engines and SSI > Hello, > > Do search engines see/read the HTML that you inc

Re: Searching for a specific spot on a page

2002-06-13 Thread Shawn
what you are looking for...but I haven't tested them. Shawn - Original Message - From: "Troy May" <[EMAIL PROTECTED]> To: "Ramprasad A Padmanabhan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 11:06 PM Subjec

Re: unable to insert data into two tables at same time

2002-06-15 Thread Shawn
... If the columns allow null and are defaulted to null, you should not have to mention them at all since you are just inserting null's... Shawn - Original Message - From: "Yuan Cheng" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 15, 2002

Re: combining data structures into one array

2002-06-18 Thread Shawn
Hello Jim, how about something along these lines: for(0..$#{$stats}) { push @stats, $stats->[$_],$totals->[$_]; } Shawn - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 11:40 AM Subject: R

Re: combining data structures into one array

2002-06-18 Thread Shawn
Errr, Well, after reading further back, I see this has already been suggested by Bob... According to your data, this should work fine for you... Do you actually end up with $stats on some and not on others (or $totals on one and not on others) so that this snippet wouldn't work?

Re: running perl scripts on Windows

2002-06-18 Thread Shawn
me across all win32 platforms... AFAIK, #!perl will work only if the perl binary is in your path correctly, otherwise, you must point it to the full path. Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: running perl scripts on Windows

2002-06-18 Thread Shawn
t line is parsed for switches, unix or > win32. As a side note, with unix, its only when you make the file > executeable that the shebang serves any other purpose. Oops, forgot about the switches... But, if you have no switches, the shebang is not needed if the command is run like: perl mysc

Debug and dereferrencing a hash

2002-06-22 Thread Shawn
t up a for loop (ie: print %$hash_ref). TIA, Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Debug and dereferrencing a hash

2002-06-22 Thread Shawn
>>> On Sat, 2002-06-22 at 13:53, Shawn wrote: >>>> Is there a reason for this, and is there a way I can see what the >>>> actuall values are? The values are passed just fine to the sub routines, >>>> I just want my debug log to show that values pas

Re: To Croak or Undef?

2002-06-22 Thread Shawn
If you are concerned about getting line numbers and sub names to return back for the error message, there are other ways to do it... I would agree that killing the script is painful for a live situation... Shawn - Original Message - From: "drieux" <[EMAIL PROTECTED]>

Re: Debug and dereferrencing a hash

2002-06-22 Thread Shawn
- Original Message - From: "Marco Antonio Valenzuela Escárcega" <[EMAIL PROTECTED]> To: "Shawn" <[EMAIL PROTECTED]> Cc: "drieux" <[EMAIL PROTECTED]>; "begin begin" <[EMAIL PROTECTED]>; "Paul Johnson" <[

Re: sorting a hash by value.

2002-06-23 Thread Shawn
Hello Pat, You can do it like so: my %hash; foreach(sort {$hash{$a} <=> $hash{$b} } keys %hash) { } Shawn - Original Message - From: "Postman Pat" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 1:46 AM Subj

Re: what does this pattern match?

2002-06-23 Thread Shawn
Hello again, This will remove all new lines from $_. Shawn - Original Message - From: "Postman Pat" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 1:49 AM Subject: what does this pattern match? > $_=~s/\n//msg; > > Wha

Re: sorting a hash by value.

2002-06-24 Thread Shawn
print "$_\n"; } If the later is all you are after, then values is what you want, but if you still want to key off of the hash itself, then you want to go with keys... I have never had a use for the later, but that is not really saying anything either... Shawn > > > >

Re: sorting a hash by value.

2002-06-24 Thread Shawn
#x27;,miss=>'31'); foreach(sort { $hash{$a} <=> $hash{$b} } values %hash) { print "$_\n"; } this will evaluate to this in the sort: $hash{122} <=> $hash{21} (as an example) This will not give you any sort at all since both values are null... Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl Debugger IDE

2002-06-24 Thread Shawn
'steps'. It is also annoying to have to pepper the scripts with debug objects... Any pointers would be greatly appreciated, Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl Debugger IDE

2002-06-28 Thread Shawn
this error to this site's webmaster. Bizarre copy of ARRAY in leave at BB/DBM.pm line ... I will forward this on to [EMAIL PROTECTED] as well I guess... I just assumed it was a problem with the debuggers, and I went on with peppering my scripts with print statements and reading those huge tail

Re: Check for integer

2002-06-29 Thread Shawn
} NOTE: This will not work for scientific notation, etc. Shawn > > > Please help. > > Thanks, > > --Donnie > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: grab user to last modify file

2002-07-01 Thread Shawn
petdance.com > > Daddy parsley.org/quinn Jk'=~/.+/s;print((split//,$&) > > [unpack'C*',"n2]3%+>\"34.'%&.'^%4+!o.'"]) > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For addi

Re: Shopping cart 2

2002-07-05 Thread Shawn
likely) you have to embed the > session id into the URLs. There was no need to pass it in the URL, a hidden form var works just fine... > > See http://jenda.krynicky.cz/C/SessionID.txt for a discussion on the > posibilities. > > Jenda Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: help dereferencing arrayref so I can put the value into a hash

2002-07-10 Thread Shawn
t;[0]\n";Fails > print "DEBUG TEST @{$avg_resp_time[0]}\n";Fails Hello Zack, I think what you are looking for is: $avg_resp_time->[0] if you want to have the '@' at the front, I think you would need something like this: @{$avg_resp_time}[0] Shawn [snip] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: anonymous reference problems

2002-07-12 Thread Shawn
key, do a push like so: push @{$oncall{$tmpEntry{'StartDate'}}}, \%tmpEntry; This will make a referenced array of hashes that you can iterate over... Shawn > reference to the memory location. > > I need something similar ...I thought about taking each value of tmpEntry > an

Re: anonymous reference problems

2002-07-12 Thread Shawn
,qq~\n~;" HASH(0x1ac2db8) HASH(0x1acf150) >perl -e "%hash=(1=>'one',2=>'two'); my $hash=\%hash; print %$hash,qq~\n~; >$hash={%hash}; print %$hash,qq~\n~;" 1one2two 1one2two Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Newbie about

2002-07-14 Thread Shawn
has a \n inside. > print length ($orgText) ; # say, I got 5 > chomp ($orgText); > print length ($orgText) ; # still 5, why ??! > chop ($orgText); > print length ($orgText) ; # I got 4 Where exactly is the '\n'? If it is not at the end of the string, chomp will do no

Re: Still Can't get perl to work on Win2K Pro PC

2002-07-16 Thread Shawn
s would be that you are in a different directory than where example.pl is saved. If this is the case, change to that directory and try it again. For the 'print ("Hello\n")', try: perl -e "print qq~Hello\n~" If it does print hello, you know that Perl is work

Re: Can get script to print to command prompt no matter what I try

2002-07-16 Thread Shawn
the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Per

Re: # question

2002-07-17 Thread Shawn
Hello, - Original Message - From: "Francesco Guglielmo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 17, 2002 4:35 AM Subject: # question > ($uno,$due,$tre,$quattro,$cinque,$sei) = split (/\s+/); > s/\#//; You probably want to w

  1   2   3   4   5   6   7   8   9   10   >