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
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
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, },
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
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]
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.
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
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
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
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
Oh that curly! Ignore my previous message. Thank you.
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
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
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;
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.
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
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
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
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
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
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;
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) ||
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) ||
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 {
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
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.
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?
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.
$| =
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.
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.
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
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
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
-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,
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;
}
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
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
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
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.
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.
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
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
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
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.
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
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 :
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';
---
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 :
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
49 matches
Mail list logo