Getting status of files before copying/moving.

2006-10-02 Thread Sara
I am copying/moving files from an FTP folder to other folders on server. The script reads the files and copy/move to separate folders etc. No problem till this point. Now the problem is that users are constantly uploading files to this folder using FTP client. The script is invoked using cron

Re: Getting status of files before copying/moving.

2006-10-02 Thread Greg Jetter
On Monday October 2 2006 9:03 pm, Sara wrote: I am copying/moving files from an FTP folder to other folders on server. The script reads the files and copy/move to separate folders etc. No problem till this point. Now the problem is that users are constantly uploading files to this folder

Regexp Basics

2006-10-02 Thread Michael Alipio
Hi, Suppose I have this: #!/usr/local/bin/perl use strict; my $string = Theres more than 1 way to do it; if ($string =~ /\w+$/){ print Hooray! pattern found; print $1; } My goal is to print the last word. However, it only prints Hooray! pattern found; Any idea what's wrong with $1?? Thanks

Maximum value in Hash

2006-10-02 Thread Andrej Kastrin
Dear all, I'm looking for simple (and fast) solution to extract maximum value from a hash. I search over the Perl mailing lists, but I didn't find anything usable. Thanks in advance for any suggestion, Andrej -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

RE: Maximum value in Hash

2006-10-02 Thread Lee Goddard
sort values %hash? -- Lee Goddard Independent Contractor, Software Development/Analysis BBC Radio Music Interactive * Room 718 | Henry Wood Hs | Regents St | London W1 1AA | UK * 020 776 50849 * lee(at)server-sidesystems.ltd.uk -Original Message- From: Andrej Kastrin

RE: Regexp Basics

2006-10-02 Thread Lee Goddard
#!/usr/local/bin/perl use strict; my $string = Theres more than 1 way to do it; if ($string =~ /\w+$/){ print Hooray! pattern found; print $1; } You need to wrap the bit you wish to extract in (paremphasis) and it'll be put into $1. If you do two (wraps), you'll get $1 and $2, and so on.

RE: Maximum value in Hash

2006-10-02 Thread Wijaya Edward
It depends what do you mean by maximum. Assume you have numerical value as hash values. You can do: use List::Util qw(max) my %hash = { foo = 3, bar=2, qux= 1}; my $max_val = max values %hash; Hope that helps. -- Regards, Edward WIJAYA From: Andrej

RE: Regexp Basics

2006-10-02 Thread Thomas Bätzler
Michael Alipio [EMAIL PROTECTED] asked: #!/usr/local/bin/perl use strict; my $string = Theres more than 1 way to do it; if ($string =~ /\w+$/){ print Hooray! pattern found; print $1; } My goal is to print the last word. However, it only prints Hooray! pattern found; Any idea what's

Re: Maximum value in Hash

2006-10-02 Thread John W. Krahn
Andrej Kastrin wrote: Dear all, Hello, I'm looking for simple (and fast) solution to extract maximum value from a hash. I search over the Perl mailing lists, but I didn't find anything usable. One way to do it: my $max; $max $_ and $max = $_ for values %hash; And another way: my $max;

Re: Maximum value in Hash

2006-10-02 Thread Andrej Kastrin
John W. Krahn wrote: Andrej Kastrin wrote: Dear all, Hello, I'm looking for simple (and fast) solution to extract maximum value from a hash. I search over the Perl mailing lists, but I didn't find anything usable. One way to do it: my $max; $max $_ and $max = $_ for

Re: Listerine

2006-10-02 Thread Derek B. Smith
-- Mathew Snyder [EMAIL PROTECTED] wrote: Sorry. Just had to do it. :) -- Mathew Snyder -- It got a laugh from me! thank you __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --

RE: Scope

2006-10-02 Thread Derek B. Smith
-- Charles K. Clarkson [EMAIL PROTECTED] wrote: John Ackley wrote: : while( ($service) = $SERVICE-fetchrow_array ) { According to the DBI docs: If there are no more rows or if an error occurs, then fetchrow_array returns an empty list. When a value is returned,

Parsing HEX Snoop Dump

2006-10-02 Thread storedge
I'm trying to parse a huge (~2-5MB) Snoop dump from our servers. The output is below: 15:44:14.57313 199.117.205.249 - s31 TCP D=57013 S=4500 Push Ack=4051907260 Seq=4004895749 Len=39 Win=49640 0: 0003 ba0c 272b 000c f860 a0f0 0800 4500'+..ø`E. 16: 004f

RE: Problem dynamically sign array a name

2006-10-02 Thread Shiping Wang
Hi Charles, At 17:18 2006-9-29, Charles K. Clarkson wrote: Shiping Wang wrote: : Yes, but it start @P = 0 .. 89; I might use the any() function available in List::MoreUtils. I try to avoid flag like the plague. use List::MoreUtils 'any'; my @P = ( 0.06, 0.04, 0.98, 0.12, 0.02,

Re: Scope

2006-10-02 Thread Chad Perrin
On Mon, Oct 02, 2006 at 07:15:38AM -0700, Derek B. Smith wrote: For a complete understanding of scope (not listerine) : ) please read the following: http://perl.plover.com/local.html#2_Localized_Filehandles and http://www.perlmonks.org/?node_id=564448 Wow...opened my eyes and I now

GD::Graph and integer on the Y-axis

2006-10-02 Thread john
Do you know how to define that all the numbers on the Y axis should be integers?

GD::Graph and integer on the Y-axis

2006-10-02 Thread john
Do you know how to define that all the numbers on the Y axis should be integers?

Re: GD::Graph and integer on the Y-axis

2006-10-02 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Do you know how to define that all the numbers on the Y axis should be integers? You have to set the format of the y-axis like so: $graph-set(y_number_format = '%d'); Where '$graph' is the GD::Graph object you previously created via the new

Smart assignment

2006-10-02 Thread Bryan R Harris
** $ptypeline = #movableortProjortho0.0000.000; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || (missing); print $ptype, \n; ** The above code prints 1, where I want it to print

Re: Smart assignment

2006-10-02 Thread Rob Dixon
Bryan R Harris wrote: ** $ptypeline = #movableortProjortho0.0000.000; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || (missing); print $ptype, \n; ** The above code prints 1,

Printing an array within a hash

2006-10-02 Thread Johnson, Reginald \(GTI\)
I am trying to print the contents of the array from within the hash. I see that I can do it by print $name: $items[0][0] $items[0][1] $items[0][2] $items[0][3] \n Is there a better way to accomplish this, especially if I don't know the number of items in the array. Here is the code:

Re: Printing an array within a hash

2006-10-02 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: I am trying to print the contents of the array from within the hash. I see that I can do it by print $name: $items[0][0] $items[0][1] $items[0][2] $items[0][3] \n Is there a better way to accomplish this, especially if I don't know the number of items in

Re: Smart assignment

2006-10-02 Thread Mumia W.
On 10/02/2006 01:54 PM, Rob Dixon wrote: Bryan R Harris wrote: ** $ptypeline = #movableortProjortho0.0000.000; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || (missing); print $ptype, \n;

Re: Smart assignment

2006-10-02 Thread Jen Spinney
On 10/2/06, Mumia W. [EMAIL PROTECTED] wrote: On 10/02/2006 01:54 PM, Rob Dixon wrote: Bryan R Harris wrote: ** $ptypeline = #movableortProjortho0.0000.000; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) ||

Re: Smart assignment

2006-10-02 Thread John W. Krahn
Jen Spinney wrote: On 10/2/06, Mumia W. [EMAIL PROTECTED] wrote: Yes, and here is another way: $ptype = (($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i)[0]) || '(missing)'; How does that way work? I was curious, so I tested it myself and it clearly did work, but I have no idea why.

RE: Querying very big database

2006-10-02 Thread Toddy Prawiraharjo
Toddy Prawiraharjo wrote: From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Friday, 29 September 2006 10:04 AM To: beginners@perl.org Subject: Re: Querying very big database Toddy Prawiraharjo wrote: Hello all, I am not sure if i'm inside the correct mailing list,