RE: Help with Variable Scope, Regular Expressions

2004-04-08 Thread Charles K. Clarkson
William Martell <[EMAIL PROTECTED]> wrote: NOTE: This response is long. If you want to ask a question be responsible and delete anything that is not relevant to your question. Do NOT top post and repeat the entire messa

RE: installing perl module without root permission

2004-04-08 Thread Wiggins d Anconia
> I am getting same error when using 'make install' : > > Warning: You do not have permissions to install into /usr/perl5/site_perl/5.005/sun4-solaris at /usr/perl5/5.00503/ExtUtils/Install.pm line 61. > mkdir /usr/perl5/site_perl/5.005/XML: Permission denied at /usr/perl5/5.00503/ExtUtils/Install

Re: Escaping

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 4:30 PM, [EMAIL PROTECTED] wrote: Is there any quick way of parsing a string like: This,Is,A,String,\,,With,A,Comma Into a list ("This", "Is", "A", "String", ",", "With, "A", "Comma") Basically, how can I split it by commas, except when it is escaped. How about: my @fields = sp

Escaping

2004-04-08 Thread Malloc7c3
Is there any quick way of parsing a string like: This,Is,A,String,\,,With,A,Comma Into a list ("This", "Is", "A", "String", ",", "With, "A", "Comma") Basically, how can I split it by commas, except when it is escaped. Dan

RE: installing perl module without root permission

2004-04-08 Thread Jayakumar Rajagopal
I am getting same error when using 'make install' : Warning: You do not have permissions to install into /usr/perl5/site_perl/5.005/sun4-solaris at /usr/perl5/5.00503/ExtUtils/Install.pm line 61. mkdir /usr/perl5/site_perl/5.005/XML: Permission denied at /usr/perl5/5.00503/ExtUtils/Install.pm l

Re: Help with Variable Scope, Regular Expressions

2004-04-08 Thread William Martell
Hello Mr. Clarkson, When I run my code on the attached test data file, I get this. [RESULT] " price: $825","beds: 3","baths: 1"," price: $825","phone: 214-821-2794","address: 2731 San Diego","location: Casa View ","paper: The Dallas Morning News","date: 04/06/2004"," price: $800","beds: 3","baths

Re: alias a function

2004-04-08 Thread JupiterHost.Net
that's one feature of goto &foo and another has to do with transfering the current call to another so caller is fooled to believe the function is actually called directly Excellent, thansk for the info David! I'll have to perldoc -f goto since I'm not realy familiar with it and its own issues

Re: alias a function

2004-04-08 Thread JupiterHost.Net
goto() just kind of uses the current @_ if I remeber right, correct? Not just that. If all you wanted was to call foo with the current @_ youd write it like this: sub bar { &foo; } The goto &foo; does more. It replaces bar() by foo() in call stack. So if foo() calls caller() or croaks() it

RE: Help with Variable Scope, Regular Expressions

2004-04-08 Thread Charles K. Clarkson
William Martell <[EMAIL PROTECTED]> wrote: : : I am trying to get this code to write the variables in : a specific order, even if they are undefined or blank. : I would like each row seperated by newline. What is a row? What specific order? : I am running into a problem with the scope of the

Re: alias a function

2004-04-08 Thread david
Jupiterhost.Net wrote: > > > david wrote: > >> Jupiterhost.Net wrote: >> >> >>>Hello list, >>> >>>I was looking into the best way (and for what reasons) you'd create an >>>"alais" function. >>> >>>For example: >>> >>>If you want foo() and bar() to be able to be used interchangeably would >>>

Re: alias a function

2004-04-08 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]> > david wrote: > > for these simple examples, it doesn't matter much and i would go > > with the first method. functionality wise, they are pretty much the > > same but there are differences that you might want to observe when > > your foo function gets m

Re: alias a function

2004-04-08 Thread JupiterHost.Net
david wrote: Jupiterhost.Net wrote: Hello list, I was looking into the best way (and for what reasons) you'd create an "alais" function. For example: If you want foo() and bar() to be able to be used interchangeably would it be best to do: sub foo { return "Howdy $_[0]"; } sub bar { retur

Re: windows user group

2004-04-08 Thread Jenda Krynicky
From: Thomas Browner <[EMAIL PROTECTED]> > I am working a project the requires me to get the group name of a user > on a windows domain. Can someone tell me were to start looking. Win32::Lanman or Win32::AdminMisc Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to w

Re: installing perl module without root permission

2004-04-08 Thread Wiggins d Anconia
> Hi friends, > I am in this condition : > (1) I have to install XML::Simple or XML::Twig or such XML module. > (2) Here Sys. administrator, does not install/ or allow me to install (1). When I try to use within my user, it says 'no permission' for wrting. >

Re: How to get the size of a hash?

2004-04-08 Thread Rob Dixon
Dermot Paikkos wrote: > > I have written something in ModPerl (extremely proud of myself) [and stuff] Well done Dermot. Writing functional code and being proud of it is about 88% of the job. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

windows user group

2004-04-08 Thread Thomas Browner
Hi, I am working a project the requires me to get the group name of a user on a windows domain. Can someone tell me were to start looking. Thanks Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help with Variable Scope, Regular Expressions

2004-04-08 Thread Jayakumar Rajagopal
n - indicates you are sorting on the field [ that comes after ] 'n' th "," -- sorry for typo. -Original Message- From: Jayakumar Rajagopal Sent: Thursday, April 08, 2004 2:31 PM To: William Martell; [EMAIL PROTECTED] Subject: RE: Help with Variable Scope, Regular

RE: Help with Variable Scope, Regular Expressions

2004-04-08 Thread Jayakumar Rajagopal
Willam, You use in your code : my @alllines; while ( ) { my $line; all your while loop code.. push @allines, $line; } @alllines = sort @alllines; Within while loop, replace every ' print "..";' with '$line .= sprintf ".. "

Re: alias a function

2004-04-08 Thread david
Jupiterhost.Net wrote: > Hello list, > > I was looking into the best way (and for what reasons) you'd create an > "alais" function. > > For example: > > If you want foo() and bar() to be able to be used interchangeably would > it be best to do: > > sub foo { return "Howdy $_[0]"; } > sub

RE: inserting a string in between two other strings

2004-04-08 Thread Jayakumar Rajagopal
DBSmith, "Need not cross pacific ocean, when you want to go from NY to CA" :) this too works : awk '{ print $1 " mb "$2}' /tmp/filename But use Perl; program fulfillment (Jay behalf of John :) ) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, Ap

Re: inserting a string in between two other strings

2004-04-08 Thread DBSMITH
this works! thanks so much and here is another solution to share... awk '{print $1" " $2}' /tmp/filename |tr -s " "|sed 's/ / mb .g' Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 James Edward Gray II <[EMAIL PROTECTED]> 04/08/2004 01:12 PM To:

installing perl module without root permission

2004-04-08 Thread Jayakumar Rajagopal
Hi friends, I am in this condition : (1) I have to install XML::Simple or XML::Twig or such XML module. (2) Here Sys. administrator, does not install/ or allow me to install (1). When I try to use within my user, it says 'no permission' for wrting. (

Re: How to get the size of a hash?

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 12:44 PM, Dermot Paikkos wrote: Got it: if ($r->param("$param") ne "" ) { That works. if (length $r->param($param)) { should also work. Note: I don't quote the variable name. It's not needed. I was suggesting just dropping defined(): if ($r->param($param)) { That probab

Re: How to get the size of a hash?

2004-04-08 Thread Dermot Paikkos
Got it: if ($r->param("$param") ne "" ) { $num is now 10 and that right (only 2 stories this time). Thanx v.much for your time. Dp. On 8 Apr 2004 at 12:33, James Edward Gray II wrote: > On Apr 8, 2004, at 12:23 PM, Dermot Paikkos wrote: > > > That's gives me all the keys (50) and I have

Re: How to get the size of a hash?

2004-04-08 Thread Dermot Paikkos
You are right on the money. I am getting empty strings: $hash{a1_head} => This is my first headline $hash{a1_des} => This is my first description $hash{a1_spllink} => This is my first SPL link $hash{a1_storyfrom} => The New Scientist $hash{a1_storylink} => http://www.newsciencetist.com $hash{a2_he

Re: How to get the size of a hash?

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 12:23 PM, Dermot Paikkos wrote: That's gives me all the keys (50) and I have only filled in three stories. I would expect to get 30 in that case but something isn't quite right at 'if (defined($r->param...' because both keys and vaules return 50 which is the total number of poss

Re: How to get the size of a hash?

2004-04-08 Thread Dermot Paikkos
That's gives me all the keys (50) and I have only filled in three stories. I would expect to get 30 in that case but something isn't quite right at 'if (defined($r->param...' because both keys and vaules return 50 which is the total number of possible fields and not simply the ones with a value

Re: How to get the size of a hash?

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 12:03 PM, Dermot Paikkos wrote: Hi, I have written something in ModPerl (extremely proud of myself) but have hit a snag. The program returns the input from a form. Unfortunately I can't post a url to the form. The form has ten sections, each section is a story synopsis. Within

Re: inserting a string in between two other strings

2004-04-08 Thread gohaku
On Apr 8, 2004, at 1:01 PM, [EMAIL PROTECTED] wrote: Does anyone have a one liner using perl, awk or sed that will insert "mb" between the "6" and "f" ? For example, 144.06 free There's probably a shorter way but I have: $str = '144.06 free'; $str =~ s/6.*?free/6mb free/si; print $str; -- T

Re: inserting a string in between two other strings

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 12:01 PM, [EMAIL PROTECTED] wrote: Does anyone have a one liner using perl, awk or sed that will insert "mb" between the "6" and "f" ? For example, 144.06 free Not exactly what you asked for, but try: perl -pi.bak -e 's/(\d)\s*(free)/$1mb $2/g' file_to_modify James -- To

Help with Variable Scope, Regular Expressions

2004-04-08 Thread William Martell
Hello All. Thank you for reading my email :) I am trying to get this code to write the variables in a specific order, even if they are undefined or blank. I would like each row seperated by newline. I am running into a problem with the scope of the variable being limited to the block of code it

How to get the size of a hash?

2004-04-08 Thread Dermot Paikkos
Hi, I have written something in ModPerl (extremely proud of myself) but have hit a snag. The program returns the input from a form. Unfortunately I can't post a url to the form. The form has ten sections, each section is a story synopsis. Within each story are 5 fields. I gather all the form d

inserting a string in between two other strings

2004-04-08 Thread DBSMITH
Does anyone have a one liner using perl, awk or sed that will insert "mb" between the "6" and "f" ? For example, 144.06 free Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145

alias a function

2004-04-08 Thread JupiterHost.Net
Hello list, I was looking into the best way (and for what reasons) you'd create an "alais" function. For example: If you want foo() and bar() to be able to be used interchangeably would it be best to do: sub foo { return "Howdy $_[0]"; } sub bar { return foo(@_); } or do a typeglob: sub

RE: Getting into programming with perl.

2004-04-08 Thread Tim Johnson
There have been many threads on this discussion, so if you want a good list, try doing a search on google groups. -Original Message- From: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 9:06 AM To: Leke Lapinkangas; [EMAIL PROTECTED] Subject: Re: Get

Re: Getting into programming with perl.

2004-04-08 Thread Flemming Greve Skovengaard
Leke Lapinkangas wrote: Hi, Can anyone recommend books which might be useful to somebody who has never programmed in any language before? Though something linked in with perl would be an advantage. Thanks, Leke Hi. I can highly recommend 'Learning Perl 3rd Edition' from O'Reilly. It is easy to

Re: CPAN

2004-04-08 Thread Wiggins d Anconia
> I am accessing CPAN as an un-priviledged user and run into a problem during > make install. CPAN quits suggesting I su to run make install. > Do you have 'su' permissions or not? The easiest thing to do is to become a privileged user and let CPAN install the modules where it will... this isn'

Re: AW: book suggestion for atypical beginner

2004-04-08 Thread WC -Sx- Jones
Thomas Bätzler wrote: And the fact that they want to sell Safari subscriptions has nothing to do with it, right? ;-) They are in business. Creating, Oraginzing, and Maintaining Content is the SECOND largest expense a company will need to budget. Personnel training being the top consideration; if t

Re: Help in using Modules

2004-04-08 Thread Wiggins d Anconia
> > Hi all, > > i am new to using perl... > > i want to use perl modules in my code. > > can any one tell me how to load a perl module so that it can be used!!! > > I am trying to use a module named Nary.pm in my code... tree.pl > first line of my code says > > use Nary; # Module i

RE: Help in using Modules

2004-04-08 Thread Wiggins d Anconia
Please bottom post > > Hi Urvashi, > You can write > ## > use lib "directory path where you have put you modules"; > use Nary.pm; > ## > in the begining of your script. > The more

Re: AW: book suggestion for atypical beginner

2004-04-08 Thread WC -Sx- Jones
Randal L. Schwartz wrote: So, no more nice CDs. Just dead trees. Lots of em. I think it is unfortunate that no more CDs will be created -- but then again once a book is printed or a CD is burned: "It is Out-of-date" "Living" on-line media (like safari et al) is the only way to keep ahead of the

RE: An extremely newbie question about appending records in a fil e.

2004-04-08 Thread Walt Weaver
On Wed, 2004-04-07 at 13:21, Bob Showalter wrote: > Weaver, Walt wrote: > > Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a > > semicolon to the end of each record in a file in Linux. > > > > It does that just fine. Unfortunately it also prepends a semicolon > > onto the beginning of

Re: Unique Dir Listing

2004-04-08 Thread Jeff 'japhy' Pinyan
On Apr 8, Ben Crane said: >I need to get a unique list of directories/sub-dirs, >etc for certain drives...the problem is, when I run >the following code, I get loads and loads of >duplicates, which isn't what I want. The reason is because you're not printing the entries you find when they happen

RE: AW: book suggestion for atypical beginner

2004-04-08 Thread Thomas Bätzler
Randall wrote: > In fact, let me take this one step further. I've been told recently > (although I might be misremembering) that O'Reilly will publish NO > MORE CDs because of rampant piracy. And the fact that they want to sell Safari subscriptions has nothing to do with it, right? ;-) Thomas -

Re: AW: book suggestion for atypical beginner

2004-04-08 Thread WilliamGunther
In a message dated 4/8/2004 7:49:04 AM Eastern Daylight Time, [EMAIL PROTECTED] writes: >Holger> Holger Schell > >Randal> Sir, how do you sleep at night? You personally offend me now. >Randal> You've just taken money DIRECTLY out of my pocket. You deserve the money too. You've helped a lot of p

[OT] Re: AW: book suggestion for atypical beginner

2004-04-08 Thread Morbus Iff
>In fact, let me take this one step further. I've been told recently >(although I might be misremembering) that O'Reilly will publish NO >MORE CDs because of rampant piracy. Last I heard, Safari was going to make it *easier* for you to read books offline, which sounds like they're just removing t

Re: AW: book suggestion for atypical beginner

2004-04-08 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz <[EMAIL PROTECTED]> writes: Holger> Holger Schell Randal> Sir, how do you sleep at night? You personally offend me now. Randal> You've just taken money DIRECTLY out of my pocket. In fact, let me take this one step further. I've been told recently (although

Re: AW: book suggestion for atypical beginner

2004-04-08 Thread Randal L. Schwartz
> "Holger" == Holger Schell <[EMAIL PROTECTED]> writes: Holger> http://[deleted]/Oreilly/ Oooh yeah, thanks for pointing that out. I've just reported those MAJOR COPYRIGHT PIRATES to [EMAIL PROTECTED] Here's to hoping that they get shut down very soon now. Holger> Best regards, Holger> Ho

Re: Perl/TK

2004-04-08 Thread Randal L. Schwartz
> "WilliamGunther" == WilliamGunther <[EMAIL PROTECTED]> writes: WilliamGunther> Two books. Learning Perl/Tk and Mastering Perl/Tk. I think Mastering Perl/Tk WilliamGunther> is really all you need. Learning Perl/Tk is also out of print, having been entirely subsumed by Mastering Perl/Tk.

RE: Help in using Modules

2004-04-08 Thread TapasranjanMohapatra
Hi Urvashi, You can write ## use lib "directory path where you have put you modules"; use Nary.pm; ## in the begining of your script. -Original Message- From: urvashi mishra [

Re: Help in using Modules

2004-04-08 Thread Alok Bhatt
> Hi all, Hi Urvashi, > I am trying to use a module named Nary.pm in my > code... tree.pl > first line of my code says > > use Nary; # Module in the same dir as the script > Can't locate object method "new" via package "Nary" > (perhaps you forgot to load "Nary"?) at > tree-trial.pl line

AW: book suggestion for atypical beginner

2004-04-08 Thread Schell, Holger
http://iis1.cps.unizar.es/Oreilly/ Best regards, Holger Schell SAP AG, 68789 Rot (Germany) Non-ABAP Production Services SAP Production Student Phone: +49 6227 7- 66814 Fax: +49 6227 78-38366 ROT15, CU.01 -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

Unique Dir Listing

2004-04-08 Thread Ben Crane
Hi all, I need to get a unique list of directories/sub-dirs, etc for certain drives...the problem is, when I run the following code, I get loads and loads of duplicates, which isn't what I want. Can anyone tell me what is wrong with my code? It works fine with files. #!/perl/bin -w use strict;

Unique DIR listing

2004-04-08 Thread Ben Crane
Hi all, I'm trying to get a unique list of all directories on certain drives in windows. Problem is, with my script, I get tons and tons of duplicates...can anyone point out what I'm doing wrong? #!/perl/bin -w use strict; use File::Find; open (DEST, ">c:/temp/p_drive.txt") || die "opening log f

Getting into programming with perl.

2004-04-08 Thread Leke Lapinkangas
Hi, Can anyone recommend books which might be useful to somebody who has never programmed in any language before? Though something linked in with perl would be an advantage. Thanks, Leke FREE eLearning courses for Merseyside

Help in using Modules

2004-04-08 Thread urvashi mishra
Hi all, i am new to using perl... i want to use perl modules in my code. can any one tell me how to load a perl module so that it can be used!!! I am trying to use a module named Nary.pm in my code... tree.pl first line of my code says use Nary; # Module in the same dir as the scrip

Re: tracking mail logs

2004-04-08 Thread Philipp Traeder
On Wed, 2004-04-07 at 20:26, WC -Sx- Jones wrote: > Traeder, Philipp wrote: > >>-Original Message- > > Should we take this back to the perl list? After all we > are talking about writing Perl. Yes, of course. If it's getting too module-specific, we can still switch to private mails. >

CPAN

2004-04-08 Thread Tim
I am accessing CPAN as an un-priviledged user and run into a problem during make install. CPAN quits suggesting I su to run make install. Do I have to su before I do "perl _MCPAN -e shell" ? Can I continue the process in $HOME/.cpan ? Will this go to the main @INC somewhere, or be an orphan in

Re: a problem about perl cross-compiling for mipsel-linux

2004-04-08 Thread Randy W. Sims
wyh wrote: > I want to install perl to my target board with mipsel-linux.How can I cross-compile > and install perl under i686-linux(red hat)? I tried to do cross-compiling many times > as follows: > > ./Configure -Dcc=mipsel-linux-gcc -Dld=mipsel-linux-ld -Dnm=mipsel-linux-nm > -Dlocincpth=...

a problem about perl cross-compiling for mipsel-linux

2004-04-08 Thread wyh
I want to install perl to my target board with mipsel-linux.How can I cross-compile and install perl under i686-linux(red hat)? I tried to do cross-compiling many times as follows: ./Configure -Dcc=mipsel-linux-gcc -Dld=mipsel-linux-ld -Dnm=mipsel-linux-nm -Dlocincpth=... -Dloclibpth=... But