Re: qw with strings containing spaces

2007-08-09 Thread Flemming Greve Skovengaard
ideas? Mathew Why not just declare @array like this: my @array = (All, A - H, I - P, Q - Z); and then later push new variables onto it, like so: push @array, qw/1 2 3/; -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower Belief without evidence in what

Re: How do I create this string?

2007-03-20 Thread Flemming Greve Skovengaard
John W. Krahn wrote: Flemming Greve Skovengaard wrote: Travis Thornhill wrote: I need to make strings of variable length for testing inputs. The strings can contain any letter, say 'a', and I need to be able to create the string with 255, 256 or any length. Is there a quick and easy

Re: How do I create this string?

2007-03-19 Thread Flemming Greve Skovengaard
); for (1..$length) { $index = int rand(scalar @letters-1); $rand_string .= $letters[$index]; } print $rand_string, \n; -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerThe world is doomed to die [EMAIL PROTECTED

Re: Time::Local let me faint

2006-08-29 Thread Flemming Greve Skovengaard
the months are 0-indexed (0-11), so timelocal(0,0,0,31,8,2006) is 2006-7-31 *not* 2006-8-31. It also say so in the documentation. perldoc Time::Local Hope it helps. -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour

Re: regex to match a range of numbers

2006-06-08 Thread Flemming Greve Skovengaard
Joshua Colson wrote: On Thu, 2006-06-08 at 00:55 +0200, Flemming Greve Skovengaard wrote: If you are just going to print the day number and you have other dates in a similar format why not just use: print +(split /\s+/, $date)[2]; Well, in this particular instance, I am. However, there have

Re: regex to match a range of numbers

2006-06-07 Thread Flemming Greve Skovengaard
in a similar format why not just use: print +(split /\s+/, $date)[2]; -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the fortune, the pain, [EMAIL PROTECTED] Go to war again, blood is freedom's stain, 4181.33

Re: Date difference.

2006-04-06 Thread Flemming Greve Skovengaard
. $yday is the day of the year, in the range 0..364 (or 0..365 in leap years.) $isdst is true if the specified time occurs during daylight savings time, false otherwise. Hope it helps. -- Flemming Greve Skovengaard Man still has one

Re: A Strange Syntax

2005-12-05 Thread Flemming Greve Skovengaard
is not imported at ... when using 'use strict;' ( as you should ). -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerThe world is doomed to die [EMAIL PROTECTED] Fire in the sky 4112.38 BogoMIPS

Re: regex puzzle

2005-07-29 Thread Flemming Greve Skovengaard
is valid. ftp:/foo is valid. why http://; and ftp:/foo can pass the check? Because ((http|ftp):\/\/) is optional ( the ? following it does that ), so any line with anything between the start and end of the line will pass. -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower

Re: Internal server error

2005-02-08 Thread Flemming Greve Skovengaard
! India Matrimony: Find your life partneronline. Post your code if you want help, most of us don't have psychic powers :) -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the fortune, the pain, [EMAIL PROTECTED

Re: LWP get_tag('img')

2004-12-09 Thread Flemming Greve Skovengaard
; my $i = $img_tag-[1]; # attributes of this img tag my $code = $i-{'src'}; if($counter == 11) { print $code\n; last; } } But there is properly a better solution. -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower

Re: problem printf

2004-10-26 Thread Flemming Greve Skovengaard
requires explicit package name at ./checksum.pl line 14. Good, now you're on the right track. Declare those variables ( with my ) and read the reply by John W. Krahn. -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPower

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: Why does this dont work in my Script? open (TEST, /tmp/test.txt); while (TEST) { print $_; # or just print; } Does the file exists and can you read it? -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPower

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: Joop, if I use open... or die $! i see that the file is opened correctly but nothing is in $_. -Ursprngliche Nachricht- Von: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Oktober 2004 11:45 An: [EMAIL PROTECTED] Cc: Bastian

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Perl guru, you know, while I can't answer why one work and the other doesn't someone else on the list might. And again, please bottompost. -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower Belief without evidence in what is told [EMAIL PROTECTED

Re: problem printf

2004-10-25 Thread Flemming Greve Skovengaard
/bin/chmod thanks Try to add this lines somewhere the top of the file: use strict; use warnings; and report the errors, if any. -- Flemming Greve Skovengaard Just a few small tears between a.k.a Greven, TuxPower Someone happy and one sad [EMAIL PROTECTED

Re: How to empty the buffer

2004-10-24 Thread Flemming Greve Skovengaard
. How? Regards Sreedhar $msg2 = ; -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerA tale of death and doom [EMAIL PROTECTED] Odin saw the final sign 4112.38 BogoMIPS The end

Re: Need Help

2004-10-07 Thread Flemming Greve Skovengaard
. -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerThe world is doomed to die [EMAIL PROTECTED] Fire in the sky 4112.38 BogoMIPS The end is coming soon -- To unsubscribe, e-mail

Re: How to access first key of Hash of Hash

2004-09-29 Thread Flemming Greve Skovengaard
as mention before. -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerA tale of death and doom [EMAIL PROTECTED] Odin saw the final sign 4112.38 BogoMIPS The end is coming soon

Re: qx{} and ping problem.

2004-09-09 Thread Flemming Greve Skovengaard
(.) at ./pingcheck line 7. Use of uninitialized value in pattern match (m//) at ./pingcheck line 8. ^C [EMAIL PROTECTED] gary]$ Don't you mean 'ping -n -c 50 10.1.1.31' instead of 'ping -n 50 10.1.1.31'. Else read the man page for ping. -- Flemming Greve Skovengaard Man still

Re: Using reference or throw valuables to sub ?

2004-09-08 Thread Flemming Greve Skovengaard
Is that if I throw the array to another sub also means the array would be copied and then pass to the target sub ? Yes while reference is using the same data in system memory? Yes Thanks -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower Belief without evidence

Re: A regex problem.

2004-09-06 Thread Flemming Greve Skovengaard
as such :- 20040814 Can someone help me with that regex? I am having a frustrating time of it! Much appreciated Denham -- Flemming Greve Skovengaard Man still has one belief, a.k.a Greven, TuxPower One decree that stands alone [EMAIL PROTECTED

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
the Posix module? also, why I ntoiced I had to may $month+1 otherwise it outputs a month back. why is this? thanks, derek printf (%02d/%02d/%02d\n, $month + 1, $day, $year - 100); # Only works when $year 1999. Try 'perldoc -f localtime' to learn why this works. -- Flemming Greve Skovengaard

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
Bob Showalter wrote: Flemming Greve Skovengaard wrote: printf (%02d/%02d/%02d\n, $month + 1, $day, $year - 100); # Only works when $year 1999. And when $year = 2099 :~) Stick to $year % 100; Yes, you are correct. Your solution is fool proof. -- Flemming Greve Skovengaard FAITH, n

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
, 0, 2 ) ) ); } while (D) if ( $_ =~ $foodate) { It would work, if you use sprintf as shown above. But I would write: if ( $_ =~ m/$foodate/ ) instead to eliminate confusesing when maintaining the code later. . } -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower

GD make test fails

2004-08-13 Thread Flemming Greve Skovengaard
. Is this serious enough to make GD not work? BTW, I am using: Slackware 9.1 with kernel 2.6.7 Perl 5.8.4 and I have all the prerequisites for building GD from source. -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower Belief without evidence in what is told

Re: Perl Core

2004-07-31 Thread Flemming Greve Skovengaard
is download and install. -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowera tale of death and doom [EMAIL PROTECTED] Odin saw the final sign 4112.38 BogoMIPS the end is coming soon

Re: howto 'cat file|grep foo bar|wc -l' in perl

2004-07-30 Thread Flemming Greve Skovengaard
, foo bar is one argument. How do I write this the right way? My way works, 'cause I'm always right :) No seriously TIMTOWTDI. With kind regards Met vriendelijke groet, Maurice Lucas TAOS-IT -- Flemming Greve Skovengaard Man still has one belief, a.k.a Greven, TuxPower

Re: setting the environment variables in perl

2004-07-27 Thread Flemming Greve Skovengaard
/8.1.7; use strict; use DBI; use lib '/home/samcsm/jason/myperl/lib/perl5/site_perl/'; Use this one-liner to check your environment variables: perl -Mstrict -we 'foreach my $key (sort keys %ENV) { print $key = $ENV{$key}\n }' -- Flemming Greve SkovengaardThe prophecy

Re: Reading a PDF file using PERL in UNIX

2004-07-23 Thread Flemming Greve Skovengaard
Jaffer Shaik wrote: Dear Friends, My OS is unix. Using perl, I want to read a pdf file and print its contents. How can I achieve this using perl. Regards, Jaffer. http://search.cpan.org/ Search for PDF -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven

Re: Returning variables from sub routines.

2004-07-23 Thread Flemming Greve Skovengaard
( ); #--- sub dateme{ my $process_date=' '; $process_date=localtime( ); return $process_date; } There is no problem in this sample code. But somewhere else in your program you must use $process_date without declaring it first. -- Flemming Greve SkovengaardThe killer's breed

Re: Dot not string cat?

2004-07-22 Thread Flemming Greve Skovengaard
;' -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowera tale of death and doom [EMAIL PROTECTED] Odin saw the final sign 4112.38 BogoMIPS the end is coming soon -- To unsubscribe, e-mail

Re: (repost) how can i generate 10 unique (non repeating) numbers

2004-07-22 Thread Flemming Greve Skovengaard
) you're bound to get repeated numbers. If you only want non-repeating numbers, run through the array and only unshift if the number is not in the array already. -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowera tale of death

Re: question about strict

2004-07-21 Thread Flemming Greve Skovengaard
;' in Tt to my '$TTT = shift;' and call Tt like this 'Tt($TTT)'. You should *always* use, use strict;. -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the fortune, the pain, [EMAIL PROTECTED] Go to war again

Re: using tr

2004-07-07 Thread Flemming Greve Skovengaard
/(?!^)(?=[a-z])/ /gi; # Insert two spaces where the next character is a letter (case insensitive) # and the previous is *not* start of string -- Flemming Greve SkovengaardThe prophecy of the holy Norns a.k.a Greven, TuxPowerthe world is doomed to die [EMAIL

Re: how does this work

2004-05-06 Thread Flemming Greve Skovengaard
), then cd module_name make make test make install FOR WINDOWS: You're on your own :) -- Flemming Greve Skovengaard Just a few small tears between a.k.a Greven, TuxPower Someone happy and one sad [EMAIL PROTECTED] Just a thin line drawn between 4168.08 BogoMIPS

Re: how does this work

2004-05-06 Thread Flemming Greve Skovengaard
Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the fortune, the pain, [EMAIL PROTECTED] Go to war again, blood is freedom's stain, 4168.08 BogoMIPS Don't you pray for my soul anymore

Re: Getting into programming with perl.

2004-04-08 Thread Flemming Greve Skovengaard
to understand, very well written and covers all the basic Perl, so it should get you started. -- Flemming Greve Skovengaard Be it the Devil or be it him a.k.a Greven, TuxPower You can count on just one thing [EMAIL PROTECTED] When the time is up, you'll

Re: directory operations

2004-04-01 Thread Flemming Greve Skovengaard
the line: my @file_list = /*.txt/ to my @file_list = *.txt or my @file_list = glob *.txt -- Flemming Greve Skovengaard FAITH, n. a.k.a Greven, TuxPower Belief without evidence in what is told [EMAIL PROTECTED] by one who speaks without knowledge, 4168.08

Re: string change problem

2004-03-29 Thread Flemming Greve Skovengaard
; $name =~ s/[^A-Za-z]\w*//g; #change 1 $name =~ tr/A-Z/a-z/; #change 2 print Old = $org_name\n; print New = $name\n; __END__ -- Flemming Greve SkovengaardAnd when you kill a man, you're a murderer a.k.a Greven, TuxPowerKill many, and you're a conqueror [EMAIL

Re: sort function?

2004-03-25 Thread Flemming Greve Skovengaard
); $times[$i] = $create_time; $i++; } @sorted_times = sort(@times); my $this_time; foreach $this_time (@sorted_times) { my($day, $mon, $dt, $tm, $yr) = split /\s+/,$this_time; my ($hr, $mn, $sec) = split /:/, $tm; print $this_time\n; } -- Flemming Greve Skovengaard Be it the Devil

Re: Problem recording the first digits into a scalar

2004-03-09 Thread Flemming Greve Skovengaard
regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Forestieres La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] -- Flemming Greve SkovengaardAnd when you kill a man, you're a murderer a.k.a Greven, TuxPowerKill many

Re: Problem recording the first digits into a scalar

2004-03-09 Thread Flemming Greve Skovengaard
[snip] -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the fortune, the pain, [EMAIL PROTECTED] Go to war again, blood is freedom's stain, 4168.08 BogoMIPS Don't you pray for my