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 {
>
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
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
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
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
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
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
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
/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
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
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
>
> @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
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]
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: "
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]
- 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
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]
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
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
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
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
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]
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
> 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)
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
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
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]
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]
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]
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
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
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
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/);
>
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 .= $_;
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 (/^\
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
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]
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
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
@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]
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...
- 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
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
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
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]
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
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
, 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
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,
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]
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>
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
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
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
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
, 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
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]
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
-
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
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
> > $ 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.
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
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
<22?${'y'.$_}=chr$.+64:[$$=${'y'
> !|.q| ,@$@&.,. $$$&, ..@&&$,,, $., ..!.$_},$y.=($.=~/22\|26\|3(3\|7)/x?' '
> !|.q|. @ ., ,.&,,, , .$..&. .,$ .,,!.$$:"\l$$")]};$y=~/ (.*)/;warn"$1\n"
> !|.q|. $ .,. .,$$&&$...&., @.,.&@$@ .|,map{-$|--?$r:$p.=
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.
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
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
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
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
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
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]
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
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 =~ /^${
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
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
... 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
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
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?
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]
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
t up a for loop (ie: print %$hash_ref).
TIA,
Shawn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
>>> 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
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]>
- Original Message -
From: "Marco Antonio Valenzuela Escárcega" <[EMAIL PROTECTED]>
To: "Shawn" <[EMAIL PROTECTED]>
Cc: "drieux" <[EMAIL PROTECTED]>; "begin begin" <[EMAIL PROTECTED]>; "Paul Johnson"
<[
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
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
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
>
>
> >
#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]
'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]
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
}
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]
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
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]
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]
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
,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]
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
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
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
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 - 100 of 2117 matches
Mail list logo