Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread Anthony Early
And, for increased flexibility (strict/warn OK) my @array = ( 10,20,30,40); my %array = @array; my %hash = (1,2,3,4); my @hash = %hash; print Array Element \$array[1] = $array[1]\n; print Hash Element \$hash{'1'} = $hash{'1'}\n; print Array Hash Element \$array{'10'} = $array{'10'}\n; print

Re: add new piece of html code in perl not success:internal server error

2002-12-19 Thread WilliamGunther
Post that part of your code so people can help you.

Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread kevin christopher
Hope this doesn't further belabor the issue, but just to put my two cents in, Perl syntactic rules for prefixing $, @, % are very consistent, IMHO: You just need to keep in mind the types of the values/data types ultimately being expressed, and it should become clearer. $ always prefixes

Re: add new piece of html code in perl not success:internal server error

2002-12-19 Thread eric
src=https://www.paypal.com/images/x-click-but6.gif; border=0 name=submit alt=Make payments with PayPal - it's fast, free and secure! /form so I put a line print src=https://www.paypal.com/images/x-click-but6.gif; border=0 name=submit alt=Make payments with PayPal - it's fast, free and secure!

Weekly list FAQ posting

2002-12-19 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

RE: add new piece of html code in perl not success:internal serve r error

2002-12-19 Thread Bob Showalter
-Original Message- From: eric [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 4:04 AM To: [EMAIL PROTECTED] Subject: add new piece of html code in perl not success:internal server error Dear perl users: I want to copy a piece of html code to my site,

Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread fliptop
On Wed, 18 Dec 2002 at 13:49, kevin christopher opined: kc:Hope this doesn't further belabor the issue, but just to put my kc:two cents in, Perl syntactic rules for prefixing $, @, % are kc:very consistent, IMHO: You just need to keep in mind the types of kc:the values/data types ultimately

Re: add new piece of html code in perl not success:internal server error

2002-12-19 Thread Mystik Gotan
$var = qq(img src=https://www.paypal.com/images/x-click-but6.gif; border=0 name=submit alt=Make payments with PayPal - it's fast, free and secure! /form); Or no qq, and then quotemeta($var); perldoc -f quotemeta Btw, you forgot img in the beginning :) -- Bob Erinkveld (Webmaster

Re: Perl 6 (was: Re: Confusion on @array vs $array[] vs $array)

2002-12-19 Thread fliptop
[reply cc'd to list] On Thu, 19 Dec 2002 at 06:23, Rob Richardson opined: RR:What is the advantage of these changes? RR:When is Perl 6 due out? RR:Do those links you provided describe all the differences we will see in RR:Perl 6? i'm no authority on perl 6, so i can't answer any of your

Re: Removing line-feed characters from a text file.

2002-12-19 Thread John W. Krahn
David Buddrige wrote: Hi all, Hello, I have a bunch of C++ source files that have had form-feed characters inserted in them every so often. In vi and emacs these characters appear as ^L. I am wanting to write a short perl script that will pull out these characters; I am thiking of

Searching for Apache::Request or libapreq

2002-12-19 Thread Sorin Marti
Hi, I can't find these modules on cpan: Apache::Request libapreq Where can I find them? I want to install Axkit (which works with Perl) and it needs mod_perl I installed it succesfully but a module named Apache::Request. This is the error I get: Can't locate Apache/Request.pm in @INC (@INC

Re: Searching for Apache::Request or libapreq

2002-12-19 Thread Sudarshan Raghavan
Sorin Marti wrote: Hi, I can't find these modules on cpan: Apache::Request libapreq http://search.cpan.org/author/JIMW/libapreq-1.0/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Checking header is csv file for accuracy

2002-12-19 Thread news.support.veritas.com
Before working with lines in a csv file I would like to check the headers from the file for accuracy i.e. do the headers I expect exist, and are they in the right order. Alternatively, and even better, I would like to check all headers I require exist, then for each parsed line extract only

Weekly list FAQ posting

2002-12-19 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: Checking header is csv file for accuracy

2002-12-19 Thread Perl
This should work (but beware - it is untested :) Rob my @required = qw(head1 head6 head8); my $line; for (DATA) { chomp; my @field = split /,/; my %column; # hash relating column header to column index next unless @field;

Re: Checking header is csv file for accuracy

2002-12-19 Thread Perl
Sorry - to check that the headers exist change the first part of the if() statement to: if ($line++ == 0) { my $i; $column{$_} = $i++ foreach @field; foreach (@required) { die Column $_ doesn't exist

Re: composite FAQ for this newsgroup

2002-12-19 Thread Perl
http:[EMAIL PROTECTED]/ Rob Ramprasad [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, Is there a FAQ digest of this newsgroup I can download and go through Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

ASCII Characters

2002-12-19 Thread Paul Kraus
My UNIX system prints these print commands to printer to set font as well as page breaks ect... I need to be able to add them to my reports but just inserting them doesn't do the trick so I am guessing I need the actual ASCII codes to do it. Here is the text the would print if I redirected the

RE: Removing line-feed characters from a text file.

2002-12-19 Thread Bob Showalter
-Original Message- From: David Buddrige [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:45 AM To: [EMAIL PROTECTED] Subject: Removing line-feed characters from a text file. ... How to determine the exact value of a non-printable character in a text file. I've

RE: ASCII Characters

2002-12-19 Thread Paul Kraus
Ignore. I just found my answer in the removing line feeds thread. -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 8:25 AM To: 'Perl' Subject: ASCII Characters My UNIX system prints these print commands to printer to set font as

Re: ASCII Characters

2002-12-19 Thread Rob Dixon
Hi Paul. These are ANSI escape sequences, with the square as the ASCII escape character 0x1B. This is control-[, so you can code these strings in Perl as \c[[120;72 G etc. HTH, Rob Paul Kraus [EMAIL PROTECTED] wrote in message

RE: ASCII Characters

2002-12-19 Thread Paul Kraus
Thanks. I spoke to soon. The answer I found in the line feed thread. Didn't work for this. But \c[ worked like a charm. -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 8:40 AM To: [EMAIL PROTECTED] Subject: Re: ASCII Characters Hi

Re: Checking header is csv file for accuracy

2002-12-19 Thread Jenda Krynicky
From: Perl [EMAIL PROTECTED] This should work (but beware - it is untested :) Rob my @required = qw(head1 head6 head8); my $line; for (DATA) It's much better to use while (DATA) This for (DATA) forces Perl to read the whole file into an array in memory. (Well ...

Re: Checking header is csv file for accuracy

2002-12-19 Thread Rob Dixon
Jenda Krynicky [EMAIL PROTECTED] wrote in message 3E01E02F.17624.1ED52A1C@localhost">news:3E01E02F.17624.1ED52A1C@localhost... From: Perl [EMAIL PROTECTED] This should work (but beware - it is untested :) Rob my @required = qw(head1 head6 head8); my $line; for (DATA)

Re: Checking header is csv file for accuracy

2002-12-19 Thread Jenda Krynicky
From: Rob Dixon [EMAIL PROTECTED] Jenda Krynicky [EMAIL PROTECTED] wrote in message 3E01E02F.17624.1ED52A1C@localhost">news:3E01E02F.17624.1ED52A1C@localhost... From: Perl [EMAIL PROTECTED] This should work (but beware - it is untested :) Rob my @required = qw(head1 head6

Re: Checking header is csv file for accuracy

2002-12-19 Thread Steve L
I will incorporate the for - while change you suggest.With regard to parse methods, I was intending to use the parse_csv subroutine suggested in Perl Cookbook for parsing actual data. I have tested this out and it seems to work just fine (having previously been caught out splitting CSV files). I

Re: Editors

2002-12-19 Thread David T-G
Paul, et al -- ...and then Paul Kraus said... % % All great info. Thanks. It's good to see these every once in a while... % % This is a mail list of educated adults. We do not flame war over Exactly. It is possible to state simple facts (like that vi is the only editor everyone should ever

Passing array to a function

2002-12-19 Thread Satya_Devarakonda
Hi, How can I pass an array to a function and get values back in it??? Here are excerpts from my code. sub getTimeInfo { my $sec = 0; my $min = 0; my $hour = 0; my $day = 0; my $mon = 0; my $year = 0; my $IsDST = 0; my $week_day = 0; my

Re: Passing array to a function

2002-12-19 Thread Rob Dixon
Satya I'm not sure why you're getting odd results - I ran the text of your post under Perl (with no changes) and got Satya - Dec19 20021219 12/19/2002,Thursday, Satya1 - Dec19 : 20021219 : 12/19/2002,Thursday, which looks fine to me. The proper way to return arrays from a function

Re: Passing array to a function

2002-12-19 Thread Satya_Devarakonda
I'm not sure why you're getting odd results - I ran the text of your post under Perl (with no changes) and got Satya - Dec19 20021219 12/19/2002,Thursday, Satya1 - Dec19 : 20021219 : 12/19/2002,Thursday, which

RE: Editors

2002-12-19 Thread Dylan Boudreau
For you vi fans out there here is vi for windows http://www.winvi.de/en/ -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: December 19, 2002 11:28 AM To: perl beginners Cc: Paul Kraus Subject: Re: Editors Paul, et al -- ...and then Paul Kraus said... % % All

Re: Passing array to a function

2002-12-19 Thread wiggins
On Thu, 19 Dec 2002 11:04:27 -0500, [EMAIL PROTECTED] wrote: Thank you Sir, But is it not wrong to create an array in a function and send a reference to the array back into the main function? Because the scope of the array is limited to

This should work but returns nothings - REGXPR

2002-12-19 Thread Paul Kraus
Whats wrong with this regexpr? $string = Report Total:2300,150.17 1352,768.15554,392.38277,186.72 84,321.84 31,481.08; if ($string=~ m/Report Total:\s ([\d,.]+)\s ([\d,.]+)\s ([\d,.]+)\s ([\d,.]+)\s ([\d,.]+)\s

Re: This should work but returns nothings - REGXPR

2002-12-19 Thread Jenda Krynicky
From: Paul Kraus [EMAIL PROTECTED] Whats wrong with this regexpr? $string = Report Total:2300,150.17 1352,768.15554,392.38277,186.72 84,321.84 31,481.08; if ($string=~ m/Report Total:\s ([\d,.]+)\s

RE: This should work but returns nothings - REGXPR

2002-12-19 Thread Paul Kraus
ok I knew that :) for some reason I was thinking \s meant any white space that follows but it just means any 1 white space character without quantifiers. Ok so then why does this work if (/Report Total:\s+[\d,.]+/){ print \$=$\n; } and this not work. if

Re: Passing array to a function

2002-12-19 Thread Satya_Devarakonda
Thank you very much. I come from little bit of C program so was kind of suspcious.. So I am safe using a reference created in a function. Thanks again and regards, Satya

If Statement Nested Regular Exp.

2002-12-19 Thread Paul Kraus
Any ideas why this fails. If I remove if /aged/ and just have the if /Reports ... then everything works ok. Code #!/usr/bin/perl my @files; my %age; push (@files, glob Aged*); push (@files, glob Receipts*); foreach (@files){ open FILE,$_; print $_\n; while(FILE){ if

RE: If Statement Nested Regular Exp.

2002-12-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul, I would say it is your last \s+ which probably should be written \s* which says there may or may not be whitespace after the last number you find. With the plus there must be at least one white space. Wags ;) -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]]

RE: This should work but returns nothings - REGXPR

2002-12-19 Thread Jenda Krynicky
From: Paul Kraus [EMAIL PROTECTED] ok I knew that :) for some reason I was thinking \s meant any white space that follows but it just means any 1 white space character without quantifiers. Ok so then why does this work if (/Report Total:\s+[\d,.]+/){ print \$=$\n; } and this not

Re: If Statement Nested Regular Exp.

2002-12-19 Thread Jenda Krynicky
From: Paul Kraus [EMAIL PROTECTED] Any ideas why this fails. If I remove if /aged/ and just have the if /Reports ... then everything works ok. Code #!/usr/bin/perl my @files; my %age; push (@files, glob Aged*); push (@files, glob Receipts*); foreach (@files){ open FILE,$_;

editing control characters from file

2002-12-19 Thread Johnson, Shaunn
Howdy: I have a text file that I'm trying to use, but, it has control characters at the end. [snip] test.txt: ASCII text, with very long lines, with NEL line terminators [/snip] I've tried to use 'sed' and 'tr' to remove NEL and just have an ASCII text. I've even used dos2unix, but that

Re: editing control characters from file

2002-12-19 Thread Rob Dixon
I think we may need to see your Perl code Shaunn. I've never heard of a NEL character but that may be my ignorance; do you mean newline? How do you know the control characters aren't being removed by what you've done? chomp() will remove the last character from a string if it is the input record

RE: editing control characters from file

2002-12-19 Thread Johnson, Shaunn
--thanks for the reply: --at this point, i'm still trying to figure out --how to find NEL. the ASCII chart says the following: [snip] DEC HEX OCT EDTTPU CHAR DESCRIPTION 10 00A 012 LF L/F CTRL-J LFline feed 13 00D 015 CR C/R CTRL-M CR

Excel - Getting first row number that doesn't have data

2002-12-19 Thread Paul Kraus
Is there a way using Win32::OLE to get the first row that doesn't have data. example... A B C 1 data 2 I would want the script to return A2. I already now the column I want is A. Any ideas are places to look? Paul Kraus Network Administrator PEL Supply Company

RE: Excel - Getting first row number that doesn't have data

2002-12-19 Thread Paul Kraus
I figured this out looking at posts on perlmonks.org. Where are all of these application specific functions such as usedrows-rows-{count} found? -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:43 PM To: 'Perl' Subject: Excel -

Re: Passing array to a function

2002-12-19 Thread Paul Johnson
On Thu, Dec 19, 2002 at 03:45:56PM -, Rob Dixon wrote: The proper way to return arrays from a function is to pass them by reference. I don't know if I would go that far. There is nothing wrong with returning a list from a function, but if the list gets too big (handwave here) then you

if structure voiding string when condition not met?

2002-12-19 Thread Paul Kraus
When I run this code buildexcel(Age); ... sub buildexcel{ ... my $sheet=$book-worksheets('AgeRaw') if ($_[0] eq Age); my $sheet=$book-worksheets('ReceiptsRaw') if ($_[0] eq Cash); $sheet-activate(); ... } I get this error ... Can't call method activate on an undefined value

Redirecting Output

2002-12-19 Thread Sugumar
Hi, I'm trying this command from my perl program system ( perldoc perldsc tmp.txt). I don't see the output going to the file tmp.txt; instead it shows the output in the screen.How could I get the output in some text file. Sugumar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: if structure voiding string when condition not met?

2002-12-19 Thread Paul Johnson
On Thu, Dec 19, 2002 at 02:32:15PM -0500, Paul Kraus wrote: When I run this code buildexcel(Age); ... sub buildexcel{ ... my $sheet=$book-worksheets('AgeRaw') if ($_[0] eq Age); my $sheet=$book-worksheets('ReceiptsRaw') if ($_[0] eq Cash); Get rid of the my in these

Re: ASCII Characters

2002-12-19 Thread Rob Dixon
John W. Krahn [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Paul Kraus wrote: print \e[120;72 G\e[120;43 G Of course. Thanks John. /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: if structure voiding string when condition not met?

2002-12-19 Thread Rob Dixon
You're quite right Ed, it's safer to copy the parameters at the start of a subroutine. Behind the scenes the parameter values are passed by reference, so modifying @_ directly will change the value used as the actual parameter in the calling code. Copying 'my @params = @_' will give you a local

Re: Passing array to a function

2002-12-19 Thread Rob Dixon
- Original Message - From: Paul Johnson [EMAIL PROTECTED] Newsgroups: perl.beginners To: Rob Dixon [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, December 19, 2002 7:19 PM Subject: Re: Passing array to a function On Thu, Dec 19, 2002 at 03:45:56PM -, Rob Dixon wrote:

Re: Passing array to a function

2002-12-19 Thread Satya_Devarakonda
Hi My sincere thanks go to all those who answered and are answering my question about - passing array to a function. This is my first time on a technical mailing list and so had trouble expressing my questions. I started PERL recently and am primarily from a C programming background. My

Re: Closure definition (was: Passing array to a function)

2002-12-19 Thread wiggins
On Thu, 19 Dec 2002 17:44:22 +0100, Jenda Krynicky [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] On Thu, 19 Dec 2002 11:04:27 -0500, [EMAIL PROTECTED] wrote: But is it not wrong to

RE: Reg ex help!

2002-12-19 Thread Mark Anderson
Is it always at the very end of the string? If not, then are there any other numbers enclosed in parens in the course names? Probably the following should work: $course =~ s/( \(\d+\)$//; # removes a space followed by an '(' followed by 1 or more digits, followed by ')' at the end of the string

RE: Reg ex help!

2002-12-19 Thread Toby Stuart
-Original Message- From: Johnstone, Colin [mailto:[EMAIL PROTECTED]] Sent: Friday, December 20, 2002 11:55 AM To: '[EMAIL PROTECTED]' Subject: Reg ex help! Gidday All, Im reading course names in from a text file and want to remove the course number from the end of each

Re : Reg ex help!

2002-12-19 Thread Johnstone, Colin
Thank You Toby and Mark for your help Colin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate ph 9561 8643

Re: [mail_lists] RE: Excel

2002-12-19 Thread Jim
On Monday 16 December 2002 12:21, Paul Kraus wrote: Me and a co-worker created a whole project around the creation of an Excel spreadsheet. From everything we looked around for there were no modules that allowed insertion. There was a reason for that but I am not sure what that reason is. -

PERL string manipulation

2002-12-19 Thread Johnstone, Colin
Gidday all, In PHP if I want to add something to a string I do this $output = ; $output .= A; $output .= B; $output .= C; $output .= D; print $output; How do I do the same in PERL please. Thanking you in anticipation Colin

RE: PERL String Manipulation

2002-12-19 Thread Johnstone, Colin
Gidday All, Thank You for your help, I must have some other error that I can't find. Regards Colin

RE: PERL String Manipulation

2002-12-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Let us know and maybe we can help. Wags ;) -Original Message- From: Johnstone, Colin [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 21:26 To: '[EMAIL PROTECTED]' Subject: RE: PERL String Manipulation Gidday All, Thank You for your help, I must have some other error that

Re: Redirecting Output

2002-12-19 Thread Mark Goland
this should do itperhaps someone can come up with a one liner -cut use IPC::Open3; $CMD=join ,@{ARGV[0..$#ARGV-1]}; #build up command open3( local $TMP , \*RDRFH,local $TMP ,$CMD); #run it open WR_FH, $ARGV[$#ARGV] || die could creat $ARGV[$#ARGV]: $!; print WR_FH while RDRFH ;

Removing text to the end of the line.

2002-12-19 Thread David Buddrige
Hi all, I have a bunch of C++ source files that contain the string PCN: sometext where somtext is an arbitary sequence of characters. Whenever the text PCN: occurs, I want to remove it and everything else to the end of the line. To do this, I have written the following script: while() {

Re: PERL string manipulation

2002-12-19 Thread John W. Krahn
Colin Johnstone wrote: Gidday all, Hello, In PHP if I want to add something to a string I do this $output = ; $output .= A; $output .= B; $output .= C; $output .= D; print $output; How do I do the same in PERL please. That does the same thing in perl: $ perl -le' $output = ;

Problems installing libapreq 1.0

2002-12-19 Thread Sorin Marti
Hi all, I am really stuck. I am trying to install libapreq 1.0 but it doesen't work because of the following errors. Why doesent't the package find the apache-headers? Why does it need them? How can I make sure that they are found? Can anyone help me? Errors: downloads/libapreq-1.0 make test

Re: Removing text to the end of the line.

2002-12-19 Thread David Buddrige
Hi all, Once again - I figured it out... here is the updated script: while() { my $current_line; $current_line = $_; $current_line =~ s/PCN:.*//g; print $current_line; } It worked after I took out the square brackets - although I am not sure why - since the square brackets

Re: Removing text to the end of the line.

2002-12-19 Thread John W. Krahn
David Buddrige wrote: Hi all, Hello, I have a bunch of C++ source files that contain the string PCN: sometext where somtext is an arbitary sequence of characters. Whenever the text PCN: occurs, I want to remove it and everything else to the end of the line. To do this, I have