RE: file :: find problem

2005-12-28 Thread Manoj Thakkar, Noida
Thanks a lot guys, I got my problem solved after long search on Google. Th error message about the "Can't cd to (C:/) System Volume Information: Permission denied" was because there is a volume partition in case of NTFS not allowed to access by anyone. The rest ofthe program run fine i can

problem passing argument to function

2005-12-28 Thread Khairul Azmi
Hi all, I have this problem when trying to pass an argument to a function. The following codes suppose to handle continual characters (the one that end up with character "\" to indicate a new line). That one works using a solution I found on the web but the problem is when I tried to pass the argum

Re: problem passing argument to function

2005-12-28 Thread Adriano Ferreira
On 12/28/05, Khairul Azmi <[EMAIL PROTECTED]> wrote: > That one works using a solution > I found on the web but the problem is when I tried to pass the argument to a > function declared in the same file, the argument somehow became null. > sub sample_function { > print "go in $_\n";

Image::Magick Annotate

2005-12-28 Thread S Khadar
Hi all, I am using IM as a part of my work. I have one strange - yet simple problem - I used these code in my program $ima->Annotate(fill=>'red', font=>'Generic.ttf', primitive=>'string',x =>"35", y => "30", pointsize=>'40', text=>"FU FU ~ FU F server"); but the option Annotate is not workin

why a.pl is faster than b.pl

2005-12-28 Thread Jeff Pang
hi,lists, I have two perl scripts as following: a.pl: #!/usr/bin/perl use strict; my @logs = glob "~/logs/rcptstat/da2005_12_28/da.127.0.0.1.*"; foreach my $log (@logs) { open (HD,$log) or die "$!"; while(){ if ( ($_ =~ /×¢²á/o) || ($_ =~ /Õ÷ÎÄ/o) || ($_ =~ /Ê¥µ®¿ìÀÖ/)

Each char / letter --> array from string value

2005-12-28 Thread Umesh T G
Hi List, I need to put each letter from a string to an array. I am doing it this way and it works. I wanna know if there is any other better way to do this / a built-in function. #! /usr/bin/perl $srt ="123"; $sl = length $srt; $val= join (':', split(/ */, $srt) ); @arr = split(/:/,$val); for

Re: Each char / letter --> array from string value

2005-12-28 Thread Adriano Ferreira
On 12/28/05, Umesh T G <[EMAIL PROTECTED]> wrote: > I need to put each letter from a string to an array. The usual way to tear apart a string into an array with characters is @chars = split '', $string; It is documented at C. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: Each char / letter --> array from string value

2005-12-28 Thread Chris Devers
On Wed, 28 Dec 2005, Umesh T G wrote: > I want an alternative solution, if any. Here's one: $ perl -le '$i = "abcd"; @j = split //, $i; print join "\n", @j;' a b c d $ -- Chris Devers 0ª¸IQ'‘éL -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: why a.pl is faster than b.pl

2005-12-28 Thread Chris Devers
On Wed, 28 Dec 2005, Jeff Pang wrote: > Why the a.pl is faster than b.pl? I think ever the resulte should be > opposite.Thanks. The easiest way to answer such questions is to benchmark and profile where the time in each script is being spent. These two scripts are so different in composition t

Re: GD::Help !

2005-12-28 Thread Chris Devers
On Sun, 25 Dec 2005, S Khadar wrote: > I am using GD::Graph for developing an online graph - What I need is a > (GD::Graphpoints) - Graph - I have already done this and works fine, > Now I want to draw a line (best fit straight line / trends line > (linear) ) through maximum number of points in

Re: why a.pl is faster than b.pl

2005-12-28 Thread Bob Showalter
Jeff Pang wrote: hi,lists, I have two perl scripts as following: a.pl: #!/usr/bin/perl use strict; my @logs = glob "~/logs/rcptstat/da2005_12_28/da.127.0.0.1.*"; foreach my $log (@logs) { open (HD,$log) or die "$!"; while(){ if ( ($_ =~ /×¢²á/o) || ($_ =~ /Õ÷ÎÄ/o) || ($_ =~ /

running a short perl script in a windows XP arena

2005-12-28 Thread DBSMITH
All, Here is my script and it is outputting "file is not present" when it should be outputting "temp file is good and $MHfile is there\n"; Am I missing something since I am running this is a Windows env? thank you, derek #!/usr/bin/perl use strict; use warnings; require 5.8.0; $ENV{"PATH"} = qq

RE: running a short perl script in a windows XP arena

2005-12-28 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : my $MHfile= qq(C:\\Documents*\\mh-hl7\\MHFM.*); Windows XP does not allow the asterisk in paths or filenames. This is not a valid filename. If the asterisks are supposed to be wildcards, perl will not expand them automatically. HTH, Char

RE: running a short perl script in a windows XP arena

2005-12-28 Thread Timothy Johnson
For starters, you aren't formatting your PATH variable correctly. That should be a semicolon before "C:\\Perl". -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 28, 2005 2:01 PM To: beginners@perl.org Subject: running a short perl script in

RE: running a short perl script in a windows XP arena

2005-12-28 Thread DBSMITH
ok I will take that out I reran it and still get the same error. This is not the problem. Note: this is the correct way to do it within Unix. Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams "Timo

getting a number out of a string....

2005-12-28 Thread David Gilden
Greetings, How does one just get the number part out of a string? The script below just prints 1. #!/usr/bin/perl @str = ('Gambia001.tiff','Gambia0021.tiff','Gambia031.tiff','Gambia035.tiff') ; foreach $str (@str) { $num = ($str =~ /\d+/); print "$str : $num\n"; } Thanks! Dave Gilden (kora

Re: getting a number out of a string....

2005-12-28 Thread Chris Devers
On Wed, 28 Dec 2005, David Gilden wrote: > How does one just get the number part out of a string? > > The script below just prints 1. Right. All it's doing is reporting a successful, true, match. You need to fix where the parentheses are being used: > foreach $str (@str) { > $num = ($str

Re: why a.pl is faster than b.pl

2005-12-28 Thread Jeff Pang
Hi,bob, You said: 3. It will probably be faster to use a single regex of the format: /pata|patb|patc|patd/ In fact maybe you are wrong on this.Based on my test case,the RE written as below: /pata/ || /patb/ || /patc/ || /patd/ is much faster than yours. -Original Message- >Fr

Re: getting a number out of a string....

2005-12-28 Thread Todd W
"David Gilden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings, > > How does one just get the number part out of a string? > > The script below just prints 1. > > #!/usr/bin/perl > > @str = ('Gambia001.tiff','Gambia0021.tiff','Gambia031.tiff','Gambia035.tiff') ; > > foreach

Re: Each char / letter --> array from string value

2005-12-28 Thread Umesh T G
On 12/28/05, Adriano Ferreira <[EMAIL PROTECTED]> The usual way to tear apart a string into an array with characters is @chars = split '', $string; It is documented at C. On 12/28/05, Chris Devers <[EMAIL PROTECTED]> wrote: > > $ perl -le '$i = "abcd"; @j = split //, $i; print join "\n", @j;'

getting a time diff from strings

2005-12-28 Thread Robert
I have a log that I am parsing and I can get the login and logout time string parsed out. It looks like this: 13:50:01# this is the when the user logged in 14:14:35# this is when the user logged out I need to get how much time that is but I am not sure how to go about it since it is a s

Re: getting a time diff from strings

2005-12-28 Thread Todd W
""Robert"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a log that I am parsing and I can get the login and logout time > string parsed out. It looks like this: > > 13:50:01# this is the when the user logged in > 14:14:35# this is when the user logged out > > I need