Trouble with activestate perl for windows

2007-08-30 Thread Caduceus
Every time I try to use perl 5.8.8 I keep geting the error message Barewood found where operator expected at - line 1, near /perl/bin Missing operator before bin? What am I doing wrong here and how can I fix it. I'm using activestate perl. The command I'm trying is C:/Perl/bin/perl5.8.8.exe

Re: Barewood found where operator expected?

2007-08-30 Thread mojorising
Thanks everyone! I have a much better understanding of what's going on now and am on my way. Feel pretty silly about the barewood thing. I need to keep my glasses on. :) I'm working on something else right now so I won't be able to try all this out for a bit but your comprehensive answers have

Re: how to modify a variable stored in a hash value

2007-08-30 Thread phil
On Aug 29, 9:41 am, [EMAIL PROTECTED] (Paul Lalli) wrote: On Aug 28, 11:16 pm, [EMAIL PROTECTED] (Phil) wrote: Ok so here's the deal...I have the following: $var = 123; GetOptions( 'v|var=n' = \$var); %xyz = ( type1 = { ABC = after zero comes $var, },

Appending a character to a field

2007-08-30 Thread bokjasong
Hi, I'm a perl newbie and would like to ask this question here. Let's say I have the following code. Trying to check the disk space, it's to truncate the percent sign % from the df -k output, compare the percentage field to see if it's bigger than 90%, and grasp only those lines that are and

Re: Trying to dynamically create arrays, getting can't use string as ARRAY ref

2007-08-30 Thread Justin The Cynical
Ok, I think I more or less have it. The true grocking of the hash, well, that I think will come in time with reading and experience. Thank you all for the help and pointers! Justin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Unable to locate make

2007-08-30 Thread kilaru rajeev
Hi All, I got a problem while installing the module with *CPAN.pm* shell. At the begining, it was asked to for some confiuguration settings. It could able to find almost all settings except make. At first, I ignored that and moved to install the modules but it is saying like the make test failed.

Re: Appending a character to a field

2007-08-30 Thread Jeff Pang
Try to use this way, use strict; my $percent=90; my @df; open(DFOUT, df -k|); while (DFOUT) { next if /Filesystem/i; my ($free) = /(\d+)%/; if ( $free = $percent ) { push(@df, $_); } } close DFOUT; print @df; 2007/8/30, [EMAIL PROTECTED] [EMAIL

Re: Unable to locate make

2007-08-30 Thread Chas Owens
On 8/30/07, kilaru rajeev [EMAIL PROTECTED] wrote: Hi All, I got a problem while installing the module with *CPAN.pm* shell. At the begining, it was asked to for some confiuguration settings. It could able to find almost all settings except make. At first, I ignored that and moved to install

Re: Unable to locate make

2007-08-30 Thread kilaru rajeev
Hi Chas, Thank you very much for the quick responce. I am sorry.. I forgot to mention the OS. I am installing it on my UNIX system. I manually tried to identify the the location of make. I could able to find the location. When I tried to install the module using cpan.pm shell on my system, it is

marine subroutine

2007-08-30 Thread Amichai Teumim
Hi I'm trying to understand subroutines. #!/usr/bin/perl marine() sub marine { $n += 1; #Global variable $n print Hello, sailor number $n!\n; } This doesn't work. Is marine() incorrect? How would I call the sub marine? Thanks Amichai

marine subroutine

2007-08-30 Thread Amichai Teumim
Oh that curly! Ignore my previous message. Thank you.

Re: marine subroutine

2007-08-30 Thread Jeff Pang
2007/8/30, Amichai Teumim [EMAIL PROTECTED]: Hi I'm trying to understand subroutines. #!/usr/bin/perl marine() sub marine { $n += 1; #Global variable $n print Hello, sailor number $n!\n; } This doesn't work. Is marine() incorrect? How would I call the sub marine? Because you

Re: marine subroutine

2007-08-30 Thread Martin Barth
Hi, be nice to yourself and allways use strict; and don't call subs with , unless you know why you need . hopefully you can avoid some problems when you're writing perl code. #!/usr/bin/perl use strict; marine(); HTH, Martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

marine subroutine

2007-08-30 Thread Amichai Teumim
i am trying to figure out how to use the subroutine in a library now. so I did this. I name one script sub.pl and the library sub-lib-pl: the script.pl contains: #!/usr/bin/perl use strict; require 'sub-lib.pl'; marine(); The sub-lib.pl contains: #!/usr/bin/perl sub marine { $n += 1;

Re: marine subroutine

2007-08-30 Thread Jeff Pang
2007/8/30, Amichai Teumim [EMAIL PROTECTED]: I get the error: sub-lib.pl did not return a true value at ./sub.pl line 5. Why is that? The value is 1 isn't it? to add 1 at the end of sub-lib.pl,it would work. echo 1 sub-lib.pl when 'require'ing a file,perl need it to return a true value.

Re: marine subroutine

2007-08-30 Thread Amichai Teumim
Yeah that works now. Great. Finally I'm getting this...after months. Thank you. On 8/30/07, Jeff Pang [EMAIL PROTECTED] wrote: 2007/8/30, Amichai Teumim [EMAIL PROTECTED]: I get the error: sub-lib.pl did not return a true value at ./sub.pl line 5. Why is that? The value is 1 isn't

Re: Unable to locate make

2007-08-30 Thread Chas Owens
On 8/30/07, kilaru rajeev [EMAIL PROTECTED] wrote: Hi Chas, Thank you very much for the quick responce. I am sorry.. I forgot to mention the OS. I am installing it on my UNIX system. I manually tried to identify the the location of make. I could able to find the location. When I tried to

Re: Unable to locate make

2007-08-30 Thread Mumia W.
On 08/30/2007 01:14 AM, kilaru rajeev wrote: Hi All, Hello. [...] Is there any way to promt the shell to ask for the settings again or is there any file which will contain all the details. Please help me. If you want to be able to reconfigure all of the CPAN variables, inside the

Logging STDERR and other output

2007-08-30 Thread Beginner
Hi, I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) || die Can't write to file: $!\n; } use strict; use warnings; ... ### Start some logging ### my $log; my

Re: Logging STDERR and other output

2007-08-30 Thread Mumia W.
On 08/30/2007 04:32 AM, Beginner wrote: Hi, I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) || die Can't write to file: $!\n; } use strict; use

Re: Logging STDERR and other output

2007-08-30 Thread Peter Scott
On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) || die Can't write to file: $!\n; } use strict;

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 6:32, Peter Scott wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) ||

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Peter Scott [EMAIL PROTECTED] wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) ||

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Beginner [EMAIL PROTECTED] wrote: On 30 Aug 2007 at 6:32, Peter Scott wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN {

Re: Trouble with activestate perl for windows

2007-08-30 Thread Tom Phoenix
On 8/29/07, Caduceus [EMAIL PROTECTED] wrote: Every time I try to use perl 5.8.8 I keep geting the error message Barewood found where operator expected at - line 1, near /perl/bin Missing operator before bin? What am I doing wrong here and how can I fix it. The message says that you're

Re: Trouble with activestate perl for windows

2007-08-30 Thread anders
On 29 Aug, 22:17, [EMAIL PROTECTED] (Caduceus) wrote: Every time I try to use perl 5.8.8 I keep geting the error message Barewood found where operator expected at - line 1, near /perl/bin Missing operator before bin? What am I doing wrong here and how can I fix it. I'm using activestate perl.

Re: marine subroutine

2007-08-30 Thread anders
On 30 Aug, 09:39, [EMAIL PROTECTED] (Amichai Teumim) wrote: Hi I'm trying to understand subroutines. #!/usr/bin/perl marine() sub marine { $n += 1; #Global variable $n print Hello, sailor number $n!\n; } This doesn't work. Is marine() incorrect? How would I call the sub marine?

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:59, Adriano Ferreira wrote: On 8/30/07, Beginner wrote: BEGIN { unshift @INC, '/etc/perl'; This is better done with use lib qw(/etc/perl); use lib ('/etc/perl'); Well that seems to work :-). which doesn't need the surrounding BEGIN block. $| =

RE: marine subroutine

2007-08-30 Thread Andrew Curry
That's rubbish, You can call a sub before you create it as you say. At compile time the entire code is done (bar some exceptions) The issue here is drop the unless you really know what it does my($n); marine(); sub marine { $n += 1; print Hello, sailor number $n!\n; } Works fine.

Re: marine subroutine

2007-08-30 Thread Beginner
On 30 Aug 2007 at 1:18, anders wrote: On 30 Aug, 09:39, [EMAIL PROTECTED] (Amichai Teumim) wrote: Hi I'm trying to understand subroutines. #!/usr/bin/perl marine() sub marine { $n += 1; #Global variable $n print Hello, sailor number $n!\n; } This doesn't work.

Re: Logging STDERR and other output

2007-08-30 Thread Mumia W.
On 08/30/2007 09:37 AM, Beginner wrote: [...] I tried the INIT option and that worked also and I liked the fact that my `perl -c myscript.pl` sent it's output to screen and not my log file and I can use a scalar for logfile. q1) Does this still give me the effect of getting any errors from

Re: marine subroutine

2007-08-30 Thread Martin Barth
On Thu, 30 Aug 2007 15:39:14 +0100 Andrew Curry [EMAIL PROTECTED] wrote: That's rubbish, but you get a warning like: main::a() called too early to check prototype at -e line 1. Use Prototypes at the beginning of your file if you want to write the subs at the end. HTH, Martin -- To

Re: marine subroutine

2007-08-30 Thread Beginner
On 30 Aug 2007 at 17:29, Martin Barth wrote: On Thu, 30 Aug 2007 15:39:14 +0100 Andrew Curry [EMAIL PROTECTED] wrote: That's rubbish, but you get a warning like: main::a() called too early to check prototype at -e line 1. Use Prototypes at the beginning of your file if you want to

Re: marine subroutine

2007-08-30 Thread Digger
-Original Message- From: [EMAIL PROTECTED] Sent: Thu, 30 Aug 2007 16:34:08 +0100 To: beginners@perl.org Subject: Re: marine subroutine On 30 Aug 2007 at 17:29, Martin Barth wrote: On Thu, 30 Aug 2007 15:39:14 +0100 Andrew Curry [EMAIL PROTECTED] wrote: That's rubbish,

Re: marine subroutine

2007-08-30 Thread Martin Barth
Hi, I don't get that either !!! #!/bin/perl ### junk.pl ### use strict; use warnings; sayhello(); sub sayhello { print hello\n; } thats because you're not using perls prototyping feature at all. if you define your sub that way: sub sayhallo() { print hello\n; }

Re: Logging STDERR and other output

2007-08-30 Thread Beginner
On 30 Aug 2007 at 10:07, Mumia W. wrote: On 08/30/2007 09:37 AM, Beginner wrote: [...] I tried the INIT option and that worked also and I liked the fact that my `perl -c myscript.pl` sent it's output to screen and not my log file and I can use a scalar for logfile. q1) Does

html template and tables

2007-08-30 Thread Pat Rice
Hi all I'm trying to do the following: Print out the table from an array using HTML teplates. I'm not sure of the sintax of how to get this table to display, I dont like posting code here, but I'm kinda stuck and I dont know if I am going in the right direction to do what I want to do. my main

Re: marine subroutine

2007-08-30 Thread Chas Owens
On 8/30/07, Martin Barth [EMAIL PROTECTED] wrote: On Thu, 30 Aug 2007 15:39:14 +0100 Andrew Curry [EMAIL PROTECTED] wrote: That's rubbish, but you get a warning like: main::a() called too early to check prototype at -e line 1. Use Prototypes at the beginning of your file if you want to

Re: Trouble with activestate perl for windows

2007-08-30 Thread anders
On 29 Aug, 22:17, [EMAIL PROTECTED] (Caduceus) wrote: Every time I try to use perl 5.8.8 I keep geting the error message Barewood found where operator expected at - line 1, near /perl/bin Missing operator before bin? What am I doing wrong here and how can I fix it. I'm using activestate perl.

printing long strings

2007-08-30 Thread R (Chandra) Chandrasekhar
Dear Folks, I need to print diagnostic message strings like: warn $parent/$child does not exist: verification failed\n; in conditional blocks that are nested and indented. This means that, on occasion, the message string overflows to the next line in an 80-character line in my source file.

parsing HTML content

2007-08-30 Thread ladder49
Is there a way to dump the HTML code for a web page? I need to write a script which will collect and summarize content from intranet web pages. By dump, I mean to read it the same way you would read a file and parse its contents. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: printing long strings

2007-08-30 Thread Gunnar Hjalmarsson
R (Chandra) Chandrasekhar wrote: I need to print diagnostic message strings like: warn $parent/$child does not exist: verification failed\n; in conditional blocks that are nested and indented. This means that, on occasion, the message string overflows to the next line in an 80-character line

Re: parsing HTML content

2007-08-30 Thread Jeff Pang
2007/8/30, ladder49 [EMAIL PROTECTED]: Is there a way to dump the HTML code for a web page? I need to write a script which will collect and summarize content from intranet web pages. By dump, I mean to read it the same way you would read a file and parse its contents. Thanks. You can use

Re: parsing HTML content

2007-08-30 Thread Daniel Kasak
On Thu, 2007-08-30 at 07:16 -0700, ladder49 wrote: Is there a way to dump the HTML code for a web page? I need to write a script which will collect and summarize content from intranet web pages. By dump, I mean to read it the same way you would read a file and parse its contents. Thanks.

Facing problem with perl one-liner for single quote

2007-08-30 Thread Krishnan Hariharan
Hi all, I am trying a one-liner substitution for a content in a file. original file content - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic; - I want to change it as: - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic := '0'; --- I wrote this one

Re: Facing problem with perl one-liner for single quote

2007-08-30 Thread John W. Krahn
Krishnan Hariharan wrote: Hi all, Hello, I am trying a one-liner substitution for a content in a file. original file content - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic; - I want to change it as: - signal TCLK_IN : std_logic; signal TPOS_IN :

Re: Facing problem with perl one-liner for single quote

2007-08-30 Thread Gunnar Hjalmarsson
Krishnan Hariharan wrote: I am trying a one-liner substitution for a content in a file. original file content - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic; - I want to change it as: - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic := '0'; ---

Re: Facing problem with perl one-liner for single quote

2007-08-30 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Krishnan Hariharan wrote: I am trying a one-liner substitution for a content in a file. original file content - signal TCLK_IN : std_logic; signal TPOS_IN : std_logic; - I want to change it as: - signal TCLK_IN : std_logic; signal TPOS_IN :

Re: Facing problem with perl one-liner for single quote

2007-08-30 Thread Gunnar Hjalmarsson
John W. Krahn wrote: Gunnar Hjalmarsson wrote: Use double-quotes instead, at least if you are on Windows. perl -piorig_* -e s/(TPOS_IN[^;]+)/$1 := '0'/ file_name If you do that the shell will interpret $1 as one of its variables. Yes, a *nix shell will, so on *nix you need \$1 If the