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
>
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 n
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 mar
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 add
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 tr
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 v
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
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 CPAN
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 $lo
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 war
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";
> }
>
>
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/repo
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/
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:
> > >
> > > B
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"
> " What am I doing wrong here and how can
> I fix it.
The message says that you're running a Perl program
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"
> " What am I doing wrong here and how can
> I fix it. I'm using activestate perl. The command I'm tryi
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 cal
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";
> >
>
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 t
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 unsub
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
> -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:
>>
>>> Th
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() {
p
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.
> >
>
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 pr
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 i
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"
> " What am I doing wrong here and how can
> I fix it. I'm using activestate perl. The command I'm tryi
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 additi
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 lin
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 ca
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 line
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 : std_logic
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';
---
I
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 : std
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
Use double-quotes instead, at least if you are on Windows.
perl -pi"orig_*" -e "s/(TPOS_IN[^;]+)/$1 := '0'/"
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 OP wer
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
Use double-quotes instead, at least if you are on Windows.
perl -pi"orig_*" -e "s/(TPOS_IN[^;]+)/$1 := '0'/"
If you do that the shell will interpret $1 as one of its variables.
Yes, a *nix shell will, so on *nix
43 matches
Mail list logo