Re: Appending array from HoA elements into one single array

2004-08-24 Thread John W. Krahn
Jenda Krynicky wrote: From: "John W. Krahn" <[EMAIL PROTECTED]> Edward WIJAYA wrote: Is there any efficient way to append each of this HoA's array into one single array, e.g: @name = ("fred", "barney", "george", "jane", "elroy"); my @name = map @$_, @HoA{ keys %HoA }; Why not my @name = m

Re: how to print pdf files to particular printer like LASER in windows

2004-08-24 Thread Jenda Krynicky
From: "R.MURUGAVEL" <[EMAIL PROTECTED]> > I am new to this group, I have one problem that is how > to print pdf files to the particular printer installed > our system/network systems. > > If any one helps me a very great help for me urgent > Pl? This print the file on command line: print

Re: Appending array from HoA elements into one single array

2004-08-24 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > Edward WIJAYA wrote: > > Hi, > > Hello, > > > Suppose I have this Hash of array: > > > > %HoA = { > > If you had warnings enabled then that would have produced a warning. > It should be either: > > %HoA = ( ... ); > > Or: > > $HoA = { ... }; > >

Re: Split and extract a sub-string

2004-08-24 Thread Gunnar Hjalmarsson
Rajesh Dorairajan wrote: I've to extract a CN (Common Name) from an LDAP DN. The LDAP DN is as shown below: isuer=CN=Name,OU=People,OU=com I just need to extract the Name from the above string. Right now I've my @tmpList = split ( /=CN=/, $_ ); $issuer = $tmpList[1]; But this returns the whole stri

Split and extract a sub-string

2004-08-24 Thread Rajesh Dorairajan
Hello All, I've to extract a CN (Common Name) from an LDAP DN. The LDAP DN is as shown below: isuer=CN=Name,OU=People,OU=com I just need to extract the Name from the above string. Right now I've my @tmpList = split ( /=CN=/, $_ ); $issuer = $tmpList[1]; But this returns the whole string "Name,

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Errin Larsen wrote: Perhaps: $scalar =~ s/^(a|an|the)\s*\b//i; would work better. <> Is this capturing into $1 the a|an|the (yes) and the rest of the title into $2 (no?). There is only one pair of parentheses, so only $1 is captured. I still think it's prudent to capture ev

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread John W. Krahn
Bob Showalter wrote: Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the who

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Errin Larsen
Hey, Ok, looking through this ... I'm confused. << SNIP >> > > > > Perhaps: > > > >$scalar =~ s/^(a|an|the)\s*\b//i; > > > > would work better. <> Is this capturing into $1 the a|an|the (yes) and the rest of the title into $2 (no?). After doing so, will it reverse the two ( i.e. s/^(a|a

Re: Between times

2004-08-24 Thread John W. Krahn
rmck wrote: Hello, Hello, I have a script that I want to print only if between 08:00 and 17:00. Would I match > every hour then print?? Any cleaner way to do this would be great. Thanks Cleaner? Yes, use appropriate whitespace and indentation and remove redundant code. :-) my($sec,$min,$hour,$

Re: is possible start some actions with Perl without Cron?

2004-08-24 Thread Errin Larsen
Hi, Can you help me understand the below a little better. As I understand what's going on, the Process (let's say PID=100) spawns a child with the fork() function (let's say PID=200). This (200) is assigned to $pid in the parent, and zero (0) is assigned to $pid in the child. So, what does "my

Re: Appending array from HoA elements into one single array

2004-08-24 Thread John W. Krahn
Edward WIJAYA wrote: Hi, Hello, Suppose I have this Hash of array: %HoA = { If you had warnings enabled then that would have produced a warning. It should be either: %HoA = ( ... ); Or: $HoA = { ... }; A => ["fred", "barney"], B => ["george", "jane", "elroy"], }; Is there any efficient wa

Re: searching a whole array without using a loop

2004-08-24 Thread John W. Krahn
Darren Birkett wrote: OK, to be more specific, I'm using Net::Telnet:Cisco. When logged onto a device I'm using the "show version" command, and storing the output in an array. Each element of the array will therefore contain lots of rubbish. I just want to match certain keyword(s) to determin

filehandle errors

2004-08-24 Thread DBSMITH
All, never mind about responding to the past email, I got it ! My syntax was : foreach (split /\n/, $EDM_nonactive_tapelist ) { #print OUT "$_\n" unless substr($_, 0, 5) eq '*Orig'; if ( /\((E\d+)/ ) { local $,

filehandle errors

2004-08-24 Thread DBSMITH
All, I am a little confused on how some of my code is compiling. This maybe a little long but basically my goal is: EDM Vault Tape List for client edm01 08/24/04 11:31 E01265 E00869 E00258 E00706 E00702 and I am attaining this, but not through the main program rather through a separa

Re: searching a whole array without using a loop

2004-08-24 Thread Gunnar Hjalmarsson
James Edward Gray II wrote: Gunnar Hjalmarsson wrote: if ( grep /my string/, @myarray ) { some code } Ordinarily, I wouldn't even mention this, but since the conversation is about what is fastest... The OP was not about what is fastest at all. It was about whether there is "a better

RE: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 16:19, Bob Showalter wrote: > Jose Alves de Castro wrote: > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > > > I need to pull out articles "a", "an", and "the" from the beginning > > > of title strings so that they sort properly in MySQL. What is the > > > best way to ac

RE: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Bob Showalter
Jose Alves de Castro wrote: > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > > I need to pull out articles "a", "an", and "the" from the beginning > > of title strings so that they sort properly in MySQL. What is the > > best way to accomplish that if I have a single $scalar with the > > whole

Perl, Unicode, and Hashes

2004-08-24 Thread Alex Lawson
hello, I am writing a flash card program with PERL, and I have two problems: How do I read from a file in the format: [][][] \t pronunciation [][][] \t pronunciation the [][][] basically represents any number of Unicode characters [in my case, Chinese], and the pronunciation is in re

Re: security on a html page with perl.

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Jose Alves de Castro wrote: One thing that could be done was to have the page with the form generate the hidden field in a way that only the script could validate it... But that's exactly the problem I'm talking about -- what would that solve? The machinery to do that well w

Re: searching a whole array without using a loop

2004-08-24 Thread James Edward Gray II
On Aug 24, 2004, at 9:14 AM, Gunnar Hjalmarsson wrote: Isn't grep() "specific" enough? Initially you said: $line = join(' ',@myarray); if ($line =~ /my string/) { some code } The equivalent using grep() would be: if ( grep /my string/, @myarray ) { some code } Or

Re: searching a whole array without using a loop

2004-08-24 Thread James Edward Gray II
On Aug 24, 2004, at 7:48 AM, Darren Birkett wrote: OK, to be more specific, I'm using Net::Telnet:Cisco. When logged onto a device I'm using the "show version" command, and storing the output in an array. Each element of the array will therefore contain lots of rubbish. I just want to match cer

Re: security on a html page with perl.

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:36, Chris Devers wrote: > On Tue, 24 Aug 2004, Jose Alves de Castro wrote: > > > On Tue, 2004-08-24 at 15:22, Chris Devers wrote: > > > >> The obvious way I can think of to do this is to make the download page a > >> script that checks to see that: > >> > >>* mandatory

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:39, Chris Devers wrote: > On Tue, 24 Aug 2004, Jose Alves de Castro wrote: > > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > >> I need to pull out articles "a", "an", and "the" from the beginning of > >> title strings so that they sort properly in MySQL. What is the

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the who

Re: security on a html page with perl.

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:22, Chris Devers wrote: The obvious way I can think of to do this is to make the download page a script that checks to see that: * mandatory form fields are defined as input for the download script * the referring page

Re: Between times

2004-08-24 Thread Gunnar Hjalmarsson
Rmck wrote: I have a script that I want to print only if between 08:00 and 17:00. Would I match every hour then print?? Any cleaner way to do this would be great. Thanks my($sec,$min,$hour,$mday,$mon); ($sec,$min,$hour,$mday,$mon)=localtime; You can declare and assign the variables in the same expr

Re: security on a html page with perl.

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:22, Chris Devers wrote: > On Tue, 24 Aug 2004, Joe Echavarria wrote: > > > After a user fill out a form and submit it a perl > > script takes the user to a download page of my > > website. how can i prevent a user from directly > > access the download page using the web

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Tim McGeary
Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:16, Tim McGeary wrote: Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:16, Tim McGeary wrote: > Jose Alves de Castro wrote: > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > > > >>I need to pull out articles "a", "an", and "the" from the beginning of > >>title strings so that they sort properly in MySQL. What is the best way > >>to acc

Re: security on a html page with perl.

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Joe Echavarria wrote: After a user fill out a form and submit it a perl script takes the user to a download page of my website. how can i prevent a user from directly access the download page using the web browser.., for example http://www.mydomain.com/download_page.html, i o

Re: Between times

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 14:49, rmck wrote: > Hello, Hi > I have a script that I want to print only if between 08:00 and 17:00. Would I match > every hour then print?? Any cleaner way to do this would be great. Thanks > > my($sec,$min,$hour,$mday,$mon); > ($sec,$min,$hour,$mday,$mon)=localtime; I

Re: searching a whole array without using a loop

2004-08-24 Thread Gunnar Hjalmarsson
Darren Birkett wrote: I just want to match certain keyword(s) to determine device type. I guess a for loop is the closest I'm going to get. I just thought there would be a specific function for this. Isn't grep() "specific" enough? Initially you said: $line = join(' ',@myarray); if ($line

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Tim McGeary
Jose Alves de Castro wrote: On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the whole title in it? I

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of > title strings so that they sort properly in MySQL. What is the best way > to accomplish that if I have a single $scalar with the whole title in it? I would go with substitu

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of > title strings so that they sort properly in MySQL. What is the best way > to accomplish that if I have a single $scalar with the whole title in it? I would go with substitu

security on a html page with perl.

2004-08-24 Thread Joe Echavarria
Hi there, After a user fill out a form and submit it a perl script takes the user to a download page of my website. how can i prevent a user from directly access the download page using the web browser.., for example http://www.mydomain.com/download_page.html, i only want the user to able to d

RE: Appending array from HoA elements into one single array

2004-08-24 Thread Charles K. Clarkson
From: Edward WIJAYA wrote: : Suppose I have this Hash of array: : : %HoA = { : A => ["fred", "barney"], : B => ["george", "jane", "elroy"], : }; I'll assume you mean a hash like this. Note the use of parenthesis instead of braces. my %HoA = ( A => [ qw

pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Tim McGeary
I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the whole title in it? Thanks, Tim -- Tim McGeary [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAI

Re: searching a whole array without using a loop

2004-08-24 Thread Darren Birkett
[EMAIL PROTECTED] (John W. Krahn) wrote in news:[EMAIL PROTECTED]: > > If all the elements are unique then use a hash. > > if ( exists $hash{ 'my string' } ) { > # do something > } > > > The most efficient way to determine if an element exists in an array > is to use a for loop and

Between times

2004-08-24 Thread rmck
Hello, I have a script that I want to print only if between 08:00 and 17:00. Would I match every hour then print?? Any cleaner way to do this would be great. Thanks my($sec,$min,$hour,$mday,$mon); ($sec,$min,$hour,$mday,$mon)=localtime; $timestamp=sprintf("%3s %02d %02d:%02d:%02d",$Month[$mon],$

Appending array from HoA elements into one single array

2004-08-24 Thread Edward WIJAYA
Hi, Suppose I have this Hash of array: %HoA = { A => ["fred", "barney"], B => ["george", "jane", "elroy"], }; Is there any efficient way to append each of this HoA's array into one single array, e.g: @name = ("fred", "barney", "george", "jane", "elroy"); Regards, Edward WIJAYA SINGAPORE -- To

Re: how to print pdf files to particular printer like LASER in windows

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, R.MURUGAVEL wrote: Good morning All! I am new to this group, I have one problem that is how to print pdf files to the particular printer installed our system/network systems. If any one helps me a very great help for me urgent Pl? Does this have something to do with Perl progra

how to print pdf files to particular printer like LASER in windows

2004-08-24 Thread R.MURUGAVEL
Hi, Good morning All! I am new to this group, I have one problem that is how to print pdf files to the particular printer installed our system/network systems. If any one helps me a very great help for me urgent Pl? Regards Murugavel R __ Do y

Re: seek help!!

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Puppala, Satheesh Kumar (Satheesh)** CTR ** wrote: Can anybody help me to convert XML document into MS-DOC file in Solaris enviornment using perl. This isn't a free script writing service. Please share with the list what you have tried so far, as well as what the XML data you

Re: PERL and Mobile Devices.

2004-08-24 Thread Jose Alves de Castro
I know this is old stuff, but it might be interesting to some of you On Fri, 2004-08-13 at 14:33, James Edward Gray II wrote: > On Aug 10, 2004, at 3:35 PM, JupiterHost.Net wrote: > > > I remember hearing some cell phones had perl and maybe PDA's??? > > Really? I would be very interested to kno

Re: Regex problems

2004-08-24 Thread John W. Krahn
me wrote: Hello all, Hello, I have been beating my head against the wall for a while trying to extract some data. Here is the following data: === Data 1: data1 Data 2: data2 Data 3: data3 Data 4: data4 Data 5: data5 data5 data5 data5 data5 data5 data5 data5 data5 data5 data5 data

Re: seek help!!

2004-08-24 Thread Gunnar Hjalmarsson
Satheesh Kumar ** CTR ** Puppala wrote: Can anybody help me to convert XML document into MS-DOC file in Solaris enviornment using perl. http://search.cpan.org/ -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

seek help!!

2004-08-24 Thread Puppala, Satheesh Kumar (Satheesh)** CTR **
Hai all, Can anybody help me to convert XML document into MS-DOC file in Solaris enviornment using perl. your inputs help me in agreat way thanks in advance satish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Recording Ping responses in perl part 2

2004-08-24 Thread Ben Crane
Prasanna Kothari, Excellent, I've seen the mistake I made with my program now thanx to yours! Cheers. One more thing, Is there any module that allows you to log network errors whilst the program is pinging?? Thanx Ben ___ Do you Yahoo!? Win 1 of 4,0