perl.beginners.cgi Weekly list FAQ posting

2004-08-09 Thread casey
NAME beginners-faq - FAQ for the beginners-cgi mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email

Filtering CGI Variables

2004-08-09 Thread Bill Stephenson
Hi all, I need some help. I have name/value parameters coming in from a web form that look something like this (blank lines added for clarity): firstname=bill lastname=stephenson q1=1 t1=y d1=something 1 p1=3.45 q2= t2=y

RE: Filtering CGI Variables

2004-08-09 Thread Bob Showalter
Bill Stephenson wrote: Hi all, I need some help. I have name/value parameters coming in from a web form that look something like this (blank lines added for clarity): firstname=bill lastname=stephenson q1=1 t1=y d1=something 1 p1=3.45 q2=

Perl oneliner to delete lines from a file

2004-08-09 Thread Ramprasad A Padmanabhan
I want to write a command line perl 'script' to delete one or more lines from a file , by line number for eg in sed I can do the same in two steps cat FILENAME | sed -e '1,10d' FILENAME.TMP mv FILENAME.TMP FILENAME The above mechanism has a lot of pitfalls , like maintaining

COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Luis Daniel Lucio Quiroz
Hi, $a = [ 'cn' = ['Barbara Jensen', 'Barbs Jensen'], 'sn' = 'Jensen', 'mail' = '[EMAIL PROTECTED]', 'objectclass' = ['top', 'person', 'organizationalPerson', 'inetOrgPerson' ],

RE: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Tim Johnson
Are you sure you want that top level to be an anonymous array instead of a hash? This would make more sense (see below for how to access the values). Note the {} brackets instead of the [] brackets. # my $a = {'cn' = ['Barbara Jensen',

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Ramprasad A Padmanabhan
This seems to be the result of a Net::LDAP search. I would suggest you better read the perldoc for the module , there are methods to directly give you the cn, sn etc from the entry. That way even if you upgrade the module and if the structure of the object changes you wont have to change any of

Out of Topic :-Any perl training institutes in Bangalore

2004-08-09 Thread Anand . V
Hi All, I am new to perl. I would like to know if any one of you, aware of any training institutes in bangalore for perl training. I am also learning on my own, especially this group has been highly helpfull for beginners like me, but keeping in view of vastness of perl and limited time that we

Re: Perl oneliner to delete lines from a file

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 07:34, Ramprasad A Padmanabhan wrote: I want to write a command line perl 'script' to delete one or more lines from a file , by line number Hi :-) If I understand correctly, you want to delete lines X to Y from a file, right? perl -i -ne 'print unless 1..10' file that

Re: What is this doing: eval 'exec /usr/bin/perl -T -w -S $0 ${1+$@}' if 0;

2004-08-09 Thread Jose Alves de Castro
On Sun, 2004-08-08 at 04:06, JupiterHost.Net wrote: I found this code in a script right after the she-bang line: eval 'exec /usr/bin/perl -T -w -S $0 ${1+$@}' if 0; # not running under some shell What is it doing? Hi. From `perldoc perlrun`, under -S : Typically this is used to

Re: What is this doing: eval 'exec /usr/bin/perl -T -w -S $0 ${1+$@}' if 0;

2004-08-09 Thread JupiterHost.Net
Jose Alves de Castro wrote: On Sun, 2004-08-08 at 04:06, JupiterHost.Net wrote: I found this code in a script right after the she-bang line: eval 'exec /usr/bin/perl -T -w -S $0 ${1+$@}' if 0; # not running under some shell What is it doing? Hi. From `perldoc perlrun`, under -S : Hello Jose,

File Size Calculator

2004-08-09 Thread SilverFox
Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in the right direction? Example: user enter: 59443 Script will output: 58M SilverFox -- To

Re: File Size Calculator

2004-08-09 Thread David Dorward
On 9 Aug 2004, at 14:34, SilverFox wrote: Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in the right direction? What have you got so far? Where are you

Trying To write a script

2004-08-09 Thread Singh, Harjit
I am trying to write a script that would be able to read a file. The file is broken into number of segments and each segment starts with a similar string pattern of following type: 2.2.x.y.z: followed with white space, where x, y, z numbers change throughout the file. The segment further has

Re: File Size Calculator

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 14:53, David Dorward wrote: On 9 Aug 2004, at 14:34, SilverFox wrote: Hi all, I'm trying to writing a script that will allow a user to enter a number and that number will be converted into KB,MB or GB depending on the size of the number. Can someone point me in

Re: Trying To write a script

2004-08-09 Thread James Edward Gray II
On Aug 9, 2004, at 9:05 AM, Singh, Harjit wrote: I am trying to write a script that would be able to read a file. The file is broken into number of segments and each segment starts with a similar string pattern of following type: 2.2.x.y.z: followed with white space, where x, y, z numbers change

Re: Trying To write a script

2004-08-09 Thread Gunnar Hjalmarsson
Harjit Singh wrote: I am trying to write a script that would be able to read a file. Are you? I don't see any code. verbal file description snipped What is the best approach to be able to make this possible? I have no idea. But the best approach when seeking help here is to post a small but

RE: Trying To write a script

2004-08-09 Thread Marcos . Rebelo
-Original Message- From: Singh, Harjit [mailto:[EMAIL PROTECTED] Sent: Monday, August 09, 2004 4:05 PM To: [EMAIL PROTECTED] Subject: Trying To write a script I am trying to write a script that would be able to read a file. The file is broken into number of segments and each

Re: File Size Calculator

2004-08-09 Thread Chris Devers
On Mon, 9 Aug 2004, SilverFox wrote: Example: user enter: 59443 Script will output: 58M I know this isn't getting into the spirit of things, but have you considered simply using the `units` program? % units 500 units, 54 prefixes You have: 59443 bytes You want: megabytes

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Luis Daniel Lucio Quiroz
yes, I'm pretty sure. And Ramprasad is write, it's a LDAP-Perl scructure. I need to construct this structure on fly when executin a script. So I wish first how to access. So, lets tell I want to add another element. After doing: my %hash = @{$a}; I do: $hash{'initials'} = S;

Re: question

2004-08-09 Thread DBSMITH
well yes I thought I tried that, but maybe I type something wrong b/c I am not seeing what I remember. Yours works! thanks! Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 Gunnar Hjalmarsson [EMAIL PROTECTED] 08/04/2004 06:12 PM To: [EMAIL PROTECTED]

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Chris Devers
On Mon, 9 Aug 2004, Luis Daniel Lucio Quiroz wrote: And Ramprasad is write, it's a LDAP-Perl scructure. I need to construct this structure on fly when executin a script. So I wish first how to access. So, lets tell I want to add another element. After doing: my %hash = @{$a}; Did you try a

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Luis Daniel Lucio Quiroz
Yes I do, I need array not to be hard-coded El Lun 09 Ago 2004 10:05, Chris Devers escribió: On Mon, 9 Aug 2004, Luis Daniel Lucio Quiroz wrote: And Ramprasad is write, it's a LDAP-Perl scructure. I need to construct this structure on fly when executin a script. So I wish first how to

Re: Assignment for Perl Class- hurting my brain

2004-08-09 Thread James Edward Gray II
(Let's keep our discussion on the list, for all to help and learn.) On Aug 8, 2004, at 11:08 PM, William Paoli wrote: The field format of the file is structured like this: Car Number:Driver Name:Sponsor:Owner:Crew Chief:Car Make:Mini Biography:Team Name I couldn't tell, are you struggling with

Re: Assignment for Perl Class- hurting my brain

2004-08-09 Thread Christopher J. Bottaro
William Paoli wrote: $obj = {Title} =; #Is this initilizing the attribute? I dont know why I am just not getting this stuff. Please help me. your syntax is wrong, thats all. so your assignment is make some kinda rudimentary database lookup program thingie? your program reads the file, then

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Chris Devers
On Mon, 9 Aug 2004, Luis Daniel Lucio Quiroz wrote: Yes I do, I need array not to be hard-coded So don't hard-code it then. Just modify the update command the library provides so that it does what you need it to do. Manually poking at the data structure that a library uses internally is a BAD

Re: iterate over the fields of a struct?

2004-08-09 Thread Christopher J. Bottaro
Randy W. Sims wrote: If you're using version 5.8 or later you can use restricted hashes. See `perldoc Hash::Util` heh, that was exactly what i'm looking for, thanks. ugh, now i gotta rewrite 3 days worth of code with restricted hashes instead of Class::Struct ...=/ -- To unsubscribe,

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Luis Daniel Lucio Quiroz
You are wrong, I need some more flexible, I dont know what attributes will be added, that's why I need array be coded on fly,with somthin like this $result = $ldap-add( 'cn=Barbara Jensen, o=University of Michigan, c=US', attr =$attrs); so $attrs array is formed on user commands :-P

perl.beginners Weekly list FAQ posting

2004-08-09 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: COMPLEX ARRAY STRUCTURE

2004-08-09 Thread Chris Devers
On Mon, 9 Aug 2004, Luis Daniel Lucio Quiroz wrote: You are wrong, I see. Good luck figuring it out then! -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

regex problem

2004-08-09 Thread DBSMITH
All I am getting the error from my if statement: ^* matches null string many times in regex; marked by -- HERE in m/^* -- HERE Orig/ at . I am trying to get everything except *Orig in this output : *Orig Vol: 1703FBBDED58D4AD (E00117), Seq #: 000114 in TLU: st_9840_acs_0, media: STK 984e

RE: Trying To write a script

2004-08-09 Thread Singh, Harjit
The following code is what I used to check if item number could be detected for the file I sent in the earlier email. The code seems to have failed and need a advise on it.. #!C:\perl\bin\perl5.6.1 $file1 = ' C:\perl\bin\dummy.txt' ; open (INFO, $file1 ) or die Can't open $file: $1; while

Re: Trying To write a script

2004-08-09 Thread James Edward Gray II
On Aug 9, 2004, at 3:36 PM, Singh, Harjit wrote: The following code is what I used to check if item number could be detected for the file I sent in the earlier email. The code seems to have failed and need a advise on it.. #!C:\perl\bin\perl5.6.1 $file1 = ' C:\perl\bin\dummy.txt' ; open (INFO,

Re: regex problem

2004-08-09 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: All I am getting the error from my if statement: ^* matches null string many times in regex; marked by -- HERE in m/^* -- HERE Orig/ at . I am trying to get everything except *Orig in this output : samlpe data snipped Here is my code: foreach

Re: regex problem

2004-08-09 Thread DBSMITH
I am still getting the same error with your suggestion. Does foreach read line by line? Do I need the foreach? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 Felix Li [EMAIL PROTECTED] 08/09/2004 03:56 PM To: [EMAIL PROTECTED] cc:

RE: Trying To write a script

2004-08-09 Thread Singh, Harjit
James, I made the change but still did not fix my problem.. Sunny. -Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Monday, August 09, 2004 4:41 PM To: Singh, Harjit Cc: Perl Beginners Subject: Re: Trying To write a script On Aug 9, 2004, at 3:36 PM, Singh,

Re: Trying To write a script

2004-08-09 Thread Randy W. Sims
Singh, Harjit wrote: The following code is what I used to check if item number could be detected for the file I sent in the earlier email. The code seems to have failed and need a advise on it.. A couple of suggestions/corrections: #!C:\perl\bin\perl5.6.1 use strict; use warnings; $file1 = '

RE: Trying To write a script

2004-08-09 Thread Singh, Harjit
Randy, The code is still not working with the modifications that you listed earlier. The code does not have any compilation errors but does not show the results for the variables $1, $2 and $3. I was wandering if you could think of something else that is causing the problem.

Re: Trying To write a script

2004-08-09 Thread Randy W. Sims
Singh, Harjit wrote: Randy, The code is still not working with the modifications that you listed earlier. The code does not have any compilation errors but does not show the results for the variables $1, $2 and $3. I was wandering if you could think of something else that is causing the

RE: regex problem

2004-08-09 Thread Charles K. Clarkson
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: : All I am getting the error from my if statement: : : ^* matches null string many times in regex; marked by -- : HERE in m/^* -- : HERE Orig/ at . : : I am trying to get everything except *Orig in this output : : : *Orig Vol: 1703FBBDED58D4AD

RE: Trying To write a script

2004-08-09 Thread Singh, Harjit
Randy, I tried the following code as you mentioned but still seem to be failing to do any print on the screen. The code is as follows: use strict; use warnings; # $file1 = ' C:\perl\bin\dummy.txt' ; my $file1 = ' C:\perl\bin\dummy.txt' ;

RE: regex problem

2004-08-09 Thread DBSMITH
it is a system app call that populates the $EDM_nonactive_tapelist I am not sure what you meanI'm not sure. has the Orig strings in it is not a precise statement for a computer programmer. the variable $EDM_nonactive_tapelist which is a file with the Orig strings in it ! the foreach with

Re: Trying To write a script

2004-08-09 Thread Gunnar Hjalmarsson
Harjit Singh wrote: The following code is what I used to check if item number could be detected for the file I sent in the earlier email. Did you send email to my [EMAIL PROTECTED] address? If the message in the user part of the address isn't sufficient, I can tell you that I never received your

RE: regex problem

2004-08-09 Thread Charles K. Clarkson
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: : it is a system app call that populates the : $EDM_nonactive_tapelist I am not sure what you mean : I'm not sure. has the Orig strings in it is not a : precise statement for a computer programmer. I meant that has the Orig strings in it

Net::FTP Help !

2004-08-09 Thread Chris Federico
Hi Guys and Gals , I'm new to perl ... Here is my problem .. I'm connecting fine to the remote computer and logging in fine .. what I want to do is a get all files from the remote directory . Here is is a snippet of the code $ftp-cwd($remote_dir) or die cannot change working directory ,

Re: Net::FTP Help !

2004-08-09 Thread Wiggins d Anconia
Hi Guys and Gals , I'm new to perl ... Here is my problem .. I'm connecting fine to the remote computer and logging in fine .. what I want to do is a get all files from the remote directory . Here is is a snippet of the code $ftp-cwd($remote_dir) or die cannot change working