Paul Archer wrote:
> 4:09pm, Ramprasad A Padmanabhan wrote:
>
> And the problem is not simply a puzzle, nor is it homework. If you had read
> my post more carefully, you would see that I am 1) *teaching* the class, and
> 2) want to be able to show off one concept (the range operator) before we
> h
Hi,
I am actually indeed looking to build on an already existing perl
module... i had a look at:
* Net::FTPServer
which seems pretty extensive, but from an initial view of the docs, did
not give me the ability to easily override the authentication mechnism
and use my own database for us
Brian Burns wrote:
>
> given a start and finish address like this
>
> $start_address = "10.11.1.14:;
> $finish_address = "12.13.2.3";
>
> I need to output generarate a a sequential list of addresses like the
> following:
>
> 10.11.1.14
> 10.11.1.15
> 10.11.1.16
> ...
> 12.13.1.252
> 12.13.1.25
given a start and finish address like this
$start_address = "10.11.1.14:;
$finish_address = "12.13.2.3";
I need to output generarate a a sequential list of addresses like the
following:
10.11.1.14
10.11.1.15
10.11.1.16
...
12.13.1.252
12.13.1.253
12.13.1.254
12.13.2.1
13.13.2.2
12.13.2.3
I have
> -Original Message-
> From: David Wall [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 05, 2003 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: RE: IIS Log File Conversion
>
>
>
>
> --On Thursday, September 04, 2003 9:48 AM +0100 Nigel Peck -
> MIS Web Design
> <[EMAIL PROTECTED]>
--On Thursday, September 04, 2003 9:48 AM +0100 Nigel Peck - MIS Web Design
<[EMAIL PROTECTED]> wrote:
Thanks, I found that but I'm looking for a Perl solution, should be
possible with a one liner regex substitution AFAIK.
Doesn't IIS document its log file format somewhere? I know Apache does:
Maybe I am misreading this but are you asking if anyone has written an ftp
server in perl?
Why not just use one of the many free open source ftp servers already out
there?
Paul Kraus
-Original Message-
From: simran [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 7:53 PM
To:
you could do something like
open SCRIPT, "| /path/to/script" || die("$!");
select(SCRIPT);
$|=1;
print "argument\n";
select(STDOUT);
close(SCRIPT);
perldoc perlipc
--
___
Get your free email from http://www.hackermail.com
Powered by Outblaze
--
To u
Hi All,
Has anyone written/used a simple ftp daemon, if so, can you please me to
the CPAN modules you used (i haven't found anything that really suits my
needs, can adapt a few, but maybe someone knows a module more
appropriate).
What i need:
* People to be able to connect to my ftp server
* M
Emil Perhinschi wrote:
>
> Hi!
Hello,
> I'm writing a rather complicated script, reading bibtex (my code) and
> xml (XML::Grove) files etc.
>
> I have to "use strict" and "my $variable" in order to keep references in
> check, as there are lots of them.
>
> I want to define some "global" variab
Hello All,
I have a very basic question. I need to launch a Bourne shell script using
PERL and automate the responses required by the script. I have shown the
sample shell script below:
#!/bin/sh
echo "Welcome to my script"
echo "Do you want to continue"
read ans
if [ $ans = "n" ] then
exit
Thanks for your help and for the detailed info :)
(Needless to say it works fine when i changed it to
while (<>) )
"Sudarshan Raghavan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Babylon wrote:
>
> >I know how it's supposed to be done but when i tried it in a program i'm
> >writ
Nelson Wong wrote:
>
> Hi all,
Hello,
> I have been doing redirect the output of command (an external tool, exe)
> to a file, by doing following:
>
> system( "tool.exe args args args > tempoutput");
>
> and I read tempoutput to a list, by doing following:
>
> my $FIN = new FileHandle;
> open
Hi!
I'm writing a rather complicated script, reading bibtex (my code) and
xml (XML::Grove) files etc.
I have to "use strict" and "my $variable" in order to keep references in
check, as there are lots of them.
I want to define some "global" variables in the main script instead of
passing them ar
Wong, Nelson wrote:
> Hi all,
>
>
>
> I have been doing redirect the output of command (an external tool,
> exe) to a file, by doing following:
>
>
>
> system( "tool.exe args args args > tempoutput");
You might be able to do:
my @lines =`tool.exe args args args`
Thi
On 9/4/03 at 11:34 AM, [EMAIL PROTECTED] (B. Fongo) wrote:
> Hello
>
> An argument passed to a subroutine returns wrong value.
>
> Code example:
>
> @x = (1..5);
> $x = @x;
>
> showValue ($x); # or showValue (\$x);
>
>
> sub showValue {
>
> my $forwarded = @_;
> print $forwarded
Hi all,
I have been doing redirect the output of command (an external tool, exe)
to a file, by doing following:
system( "tool.exe args args args > tempoutput");
and I read tempoutput to a list, by doing following:
my $FIN = new FileHandle;
open ($FIN,$map_file);
my @lines = ;
> "Tim" == Tim Johnson <[EMAIL PROTECTED]> writes:
Tim> So you need to change your code to:
Tim> If(@ARGV[0] eq "-q"){
Tim>print "It worked\n";
Tim> }else{
Tim>print "It did not work\n";
Tim> }
And you really need to change @ARGV[0] to $ARGV[0], or else
the "don't use an array slice
> -Original Message-
> From: Nigel Peck - MIS Web Design [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 10:26 AM
> To: [EMAIL PROTECTED]
> Subject: IIS Log File Conversion
>
>
> Does anyone have a code snippet or a module for converting
> the IIS log file format to NCSA
On Thursday, September 4, 2003, at 04:31 PM, Thomas Browner wrote:
Can some one tell me way this does not work.
I believe I can, yes. :)
if (@ARGV[0] = "-q"){print "it worked\n";}
else {print "it did not work\n";}
Okay, one issue at a time. First @ARGV[0] should be $ARGV[0]. When
we're talki
>The "==" operator checks two numeric values for comparison, returning true
>if they match
>The "eq" operator checks two string values for comparison, returning true
>if
>they match
oh dear!! i'd forgotten that detail.
sometimes i still get myself with this one.
willy
--
To unsubscribe, e-mai
>
>Can some one tell me way this does not work.
>
>
>
>if (@ARGV[0] = "-q"){print "it worked\n";}
try (@ARGV[0] == "-q")
^^ this got me too- the "==" compares values
while "=" assignes the right side value to
lef
This is a very common mistake, so don't feel bad.
The "=" operator assigns the value on the right to the variable on the left.
The "==" operator checks two numeric values for comparison, returning true
if they match
The "eq" operator checks two string values for comparison, returning true if
they
try this:
if (@ARGV[0] == "-q"){print "it worked\n";}
else {print "it did not work\n";}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Can some one tell me way this does not work.
if (@ARGV[0] = "-q"){print "it worked\n";}
else {print "it did not work\n";}
if I use a -w instead of -q it still prints it worked.
Thomas Browner
Digidyne, Inc
Technical Engineer
(251)479-1637
John, thanks for the heads-up, I saw the errors and modified the lines.
For anyone wanting to do this on their own system...
sub cleanup{
use strict;
my $dirname = "/home/data";
my $file;
my $newfile;
my $line;
opendir (DIR, $dirname) or die "Can't o
Lonewolf wrote:
>
> Thanks for everyone's help with this one, I was stuck and knew I was missing
> something simple.. UGH. perldoc -q replace didn't turn me up with anything
> either, which was a bummer, but going off the code posted here I was able to
> do more with it.
>
> This is what I used
"John W. Krahn" wrote:
>
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> ( $\, $^I ) = ( $/, '.bak' );
>
> while ( <> ) {
> s/^\s+//; # remove space at beginning of line
> s/\s+$//; # remove space at end of line
> s/\s*\|\s*/|/g; # remove space around pipe separ
Something like this will skip all files with _nice at the end...
next if $file =~ /_nice$/;
unlink ($file) or die "Couldn't delete file;
(I think that would work. Untested)
Tony
-Original Message-
From: LoneWolf [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 2:23
[EMAIL PROTECTED] wrote:
>
> Is there any way in PERL to ring a Bell or make some sound in a script. For
> example, to let you know when a task is completed. Any help would be
> appreciated.
print "\a";
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Antonio Jose wrote:
>
> Hello I have 3 weeks learning Perl and I am trying to solve a trouble
> I need to write my thesis
>
> I have to read a file where I don't know the content of the first rows
> (only strings) and I need to read only data (numbers), I mean, I am going
> to read inform
Thanks for everyone's help with this one, I was stuck and knew I was missing
something simple.. UGH. perldoc -q replace didn't turn me up with anything
either, which was a bummer, but going off the code posted here I was able to
do more with it.
This is what I used:
Is there any way in PERL to ring a Bell or make some sound in a script. For
example, to let you know when a task is completed. Any help would be
appreciated.
On Thu, 04 Sep 2003 14:23:44 -0400, zentara <[EMAIL PROTECTED]> wrote:
> On Wed, 3 Sep 2003 12:54:07 +0800, [EMAIL PROTECTED] (Jaws) wrote:
>
> >Hi all,
> >
> >I am currently using Net::SSH::Perl module to login in my remote machine.
> >Below is m
[EMAIL PROTECTED] wrote:
>
> Can someone please explain why this
>
> while (1) {
>my $item = ;
>chomp $item;
>last unless $item;
You should use a different test then true or false for $item
last unless length $item;
>$inventory{1c
On Wed, 3 Sep 2003 12:54:07 +0800, [EMAIL PROTECTED] (Jaws) wrote:
>Hi all,
>
>I am currently using Net::SSH::Perl module to login in my remote machine.
>Below is my code:
>
>==
>#!/usr/bin/perl
>
>use Net::SSH::Perl;
>
>$user="jaws";
>$pass="password";
>$host="111.
Lonewolf wrote:
>
> I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP.
> THe files from the SCO box are poorly formatted with extraneous whitespace
> (sometimes as much as 30 or more) before and after the text. I need to
> parse all of the files I DL and put them into a n
> -Original Message-
> From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 12:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Test if browser's allows cookies/has them turned onetc..
>
>
> > "Dan" == Dan Muey <[EMAIL PROTECTED]> writes:
>
> Dan> As
LoneWolf wrote:
> I have about 12 files that I am pulling for a SCO box to a RedHat
> box, FTP. THe files from the SCO box are poorly formatted with
> extraneous whitespace (sometimes as much as 30 or more) before and
> after the text. I need to parse all of the files I DL and put them
> into a new
Freddy söderlund wrote:
>
> Let me re-phrase my question a bit:
>
> I want to compare the two strings and I want to extract those chars that are
> matching each other in the first and second string (in order from the
> beginning), and put them in a new string (not array as I mistakenly said
> ear
Hi ,
I am writing this code to telnet into windows machine.
The code works fine on the unix machine and runs the command 'ps -ef'. On W2K I am
trying to telnet into the machine and to recognize the prompt 'C:\' . but it keeps on
giving the error 'time-out. I have tried different combinations of t
Thanks Peter and Wiggins, hey Peter Wiggins like Ender's brother? Cool!
Any way I appreciate all the insights and angles into the subject. I'll
Consider all that and see if it si something I need to do or not.
Thanks
Dan
PS it is a module on only one server with a really speciallized name and
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 04 Sep 2003 06:37:57 -0700, LoneWolf wrote:
> I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP.
> THe files from the SCO box are poorly formatted with extraneous whitespace
> (sometimes as much as 30 or more) before
> "Dan" == Dan Muey <[EMAIL PROTECTED]> writes:
Dan> As much as I hate to do stuff that requires cookies, there is a
Dan> project I'm doing that requires cookies.
This should have been on [EMAIL PROTECTED] instead. More experts
there about this stuff.
Having said that, you should read my "b
Perldiscuss - Perl Newsgroups And Mailing Lists wrote:
>
> I know how it's supposed to be done but when i tried it in a program i'm
> working on at the moment it isn't working quite how i expected.
>
> The program is, in it's simplest form (which still doesn't work):
> ---
Christiane Nerz wrote:
>
> Hi all!
Hello,
> I like to read several rows out of two different table-files and put
> them successively in a new file by:
>
> @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m];
You should be using push for that:
push @ergebnis_alles, $whol
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Dan Muey) writes:
>> In article
>> <[EMAIL PROTECTED]
>> nfiniplex.com>,
>> [EMAIL PROTECTED] (Dan Muey) writes:
>> >Howdy list!
>> >I was wondering...(imagine that!)
>> >
>> >If I have in my script:
>> >
>> >#!/usr/bin/perl -w
>> >use st
On Thu, 4 Sep 2003 11:17:56 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote:
>
> I have a bunch of scripts that use a module for simply sharing variables, IE if I
> change one I change it in one place instead of having to edit tons of scripts. So I
Madison Daily <[EMAIL PROTECTED]> wrote:
: Can someone please explain why this
:
: while (1) {
:my $item = ;
:chomp $item;
:last unless $item;
:$inventory{1c $item}++;
: }
:
:
: Gets Bare word found where operator expected
: Syntax error line 13
I'm quit confused with what I have below.
I have 2 database tables; Games and groups.
Name Group
#
John ,GroupA
Miler, GroupA
Peter, GroupB
Mathew, GroupB
Mark, GroupB
Luke, GroupA
I'm trying to select the members based on their groups and insert them
into a different table
On Thu, 4 Sep 2003 18:46:48 +0200 (CEST), "Paul Johnson" <[EMAIL PROTECTED]> wrote:
>
> K Old said:
> > On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote:
> >> Can someone please explain why this
> >>
> >> while (1) {
> >>my $item
K Old said:
> On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote:
>> Can someone please explain why this
>>
>> while (1) {
>>my $item = ;
>>chomp $item;
>>last unless $item;
>>$inventory{1c $item}++;
>> }
>
> You probably wanted:
>
> $inventory{'1
On Thursday, September 04, 2003 11:11, Marshall, Stephen wrote:
>
>Got it working this way fror the important line, but theres probably a
slicker way of doing it.
>
>$line =~ s/(\s)+/ /g;
>
This will work, but may leave an extraneous space at the beginning and/or
end of the line.
This text:
"
Try it like this... I was a slacker and didn't have warnings
in place if it couldn't open the file... Should be able
to just change the "/my/stuff/" to your directory and have it
work, I tested it here, and it seems to go fine. (on an aix
box - maybe I have something in place that doesn't work o
On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote:
> Can someone please explain why this
>
> while (1) {
>my $item = ;
>chomp $item;
>last unless $item;
>$inventory{1c $item}++;
> }
You probably wanted:
$inventory{'1c'}++;
or
$inventory{$item}+
Can someone please explain why this
while (1) {
my $item = ;
chomp $item;
last unless $item;
$inventory{1c $item}++;
}
Gets Bare word found where operator expected
Syntax error line 13 near 1c
thanks
Madison Daily
Weldon, Williams & Lick, Inc.
(479
> In article
> <[EMAIL PROTECTED]
> nfiniplex.com>,
> [EMAIL PROTECTED] (Dan Muey) writes:
> >Howdy list!
> >I was wondering...(imagine that!)
> >
> >If I have in my script:
> >
> > #!/usr/bin/perl -w
> > use strict;
> > use ModuleWhatever;
> >
> >And ModuleWhatever has:
> >
> > p
Got it working this way fror the important line, but theres probably a slicker way of
doing it.
$line =~ s/(\s)+/ /g;
> -Original Message-
> From: Marshall, Stephen
> Sent: 04 September 2003 17:07
> To: 'Akens, Anthony'; [EMAIL PROTECTED];
> [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subje
I have a similar problem to this , does anyone have another answer? Don't know if its
just me but The
> use strict;
> while(my $line = <>) {
> ($line) = ($line =~ /^\s*(.*)\s*\n$/);
> print($line."_nice/n");
> }
Code doesn't work , and the enhanced version with the fancy file handl
On Thu, 4 Sep 2003 10:01:43 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote:
> Howdy list!
> I was wondering...(imagine that!)
>
> If I have in my script:
>
> #!/usr/bin/perl -w
> use strict;
> use ModuleWhatever;
>
> And ModuleWha
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Dan Muey) writes:
>Howdy list!
>I was wondering...(imagine that!)
>
>If I have in my script:
>
> #!/usr/bin/perl -w
> use strict;
> use ModuleWhatever;
>
>And ModuleWhatever has:
>
> package ModuleWhatever;
> $|++;
>
Howdy list,
You know how some sites will say "You need to enable cookies for this site to use this
service"
As much as I hate to do stuff that requires cookies, there is a project I'm doing that
requires cookies.
I don't think you can set a cookie in a header then get the value of that cookie
mod_perl isn't a language, it is an application server.
If the question is "Is it mod_perl safe?", then that is a different
question. I would think they are, both are OOP, and there is no state that
I am aware of that is outside of the object properties.
Rob
-Original Message-
From: rkl
> [EMAIL PROTECTED] wrote:
> > What's the simple Perl command to find the name of the file
> from which
> > the Perl program is being executed? It was recently on
> this newsgroup
> > but I can't find the article now.
Do you mean the $0 variable?
You could also do:
use CGI qw(url);
my $se
Howdy list!
I was wondering...(imagine that!)
If I have in my script:
#!/usr/bin/perl -w
use strict;
use ModuleWhatever;
And ModuleWhatever has:
package ModuleWhatever;
$|++;
Would that turn on autoflush for the rest of the script?
IE is the above exampl
- Original Message -
From: "Rob Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 4:50 PM
Subject: Re: Extracting equal entities from two different sized arrays?
>
> ""Freddy söderlund"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
I figured I'd take a stab at fleshing this out into what he wants...
Any comments on things I could do better? I only added to what
Robert had coded...
Tony
#!/usr/bin/perl -w
use strict;
my $dirname = "/my/stuff/";
my $file;
my $newfile;
my $line;
opendir (DIR, $dirname) or die "Can't open
Babylon wrote:
> ...
> for $file ()
> {
> push @ARGV, $file;
> }
Not related to the problem, but the loop here is unnecessary. Just use:
@ARGV = ;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I figured I'd take a stab at fleshing this out into what he wants...
Any comments on things I could do better? I only added to what
Robert had coded...
Tony
#!/usr/bin/perl -w
use strict;
my $dirname = "/my/stuff/";
my $file;
my $newfile;
my $line;
opendir (DIR, $dirname) or die "Can't open
On Thursday, September 4, 2003, at 09:28 AM, Freddy Söderlund wrote:
Another example on just how *stuck* I was! You're right ofcourse and I
were
wrong when typing my example.
It's really two strings: $string1 and $string2.
Let me re-phrase my question a bit:
I want to compare the two strings a
""Freddy söderlund"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> - Original Message -
> From: "Rob Anderson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 04, 2003 3:30 PM
> Subject: Re: Extracting equal entities from two different sized arrays
[EMAIL PROTECTED] wrote:
> What's the simple Perl command to find the name of the file from
> which the Perl program is being executed? It was recently on this
> newsgroup but I can't find the article now.
Check out the FindBin module.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
On Thu, 04 Sep 2003 00:39:55 -0700, "rkl" <[EMAIL PROTECTED]> wrote:
> Hi all:
>
> Are these libs: WWW:: Mechanize and HTTP::Cookies in perl or mod_perl?
>
Written in or available in?
Written in: Perl
Available in: yes
They are standard Perl
- Original Message -
From: "Rob Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 3:30 PM
Subject: Re: Extracting equal entities from two different sized arrays?
>
> >""Freddy söderlund"" <[EMAIL PROTECTED]> wrote in
> > message news:[EMAIL PROTECTE
> How do you capture passed parameters in Perl on Windows? In
> regular perl
> its:
>$variable = param('passed');
>
> However, when I tried to run that under windows, it dies a
> horrible death? I've looked through perl.org for more
What dies a horrible death, and how?
How are you runnin
are you speaking of this?
use strict;
while(my $line = <>) {
($line) = ($line =~ /^\s*(.*)\s*\n$/);
print($line."_nice/n");
}
-Original Message-
From: LoneWolf [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 3:38 PM
To: [EMAIL PROTECTED]
Subject: Getting rid o
>""Freddy söderlund"" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>Hi!
>
Hi
>I have stuck my thoughts on this one, maybee someone can help me out?
>
>I have two arrays
>
>@array1 = "C:\Program files\directory1\directory2\directory3";
>@array2 = "C:\Program files\directory1\dir2
I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP.
THe files from the SCO box are poorly formatted with extraneous whitespace
(sometimes as much as 30 or more) before and after the text. I need to
parse all of the files I DL and put them into a new file with "_nice" added
Hi!
I have stuck my thoughts on this one, maybee someone can help me out?
I have two arrays
@array1 = "C:\Program files\directory1\directory2\directory3";
@array2 = "C:\Program files\directory1\dir2\dir3";
What I want to do is, compare the arrays, one char at a time, from the beginning and
sto
When I run your code (slightly modified) like so:
#!perl -w
[EMAIL PROTECTED] = param->('group');
@group = ("John","mark","Peter");
# let's @group contains "John, mark, Peter"
# I 'm passing exactly "John, mark, Peter" to the sub here.
do_db(@group);
sub do_db {
@x = @_;
# @x shoul
I assigned it to scalar to get the number of elements contained in the
array @x.
Printing @x 0utside the subroutine gives me the right answer (5), but
within the sub, I get 1; which is wrong.
I need the correct number of elements within the sub to use it for a
database entry.
Why does Perl give m
Christiane Nerz wrote:
Oh-oh - there was a mistake - I tried chomp, not chmod..
How do I use chomp correctly? I have an array of strings, want to cut
off the last \n in each line and use the rest of the line.
(concatenate it to another string)
Jane
Hi all!
I like to read several rows out of tw
>"Mark Weisman" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>How do you capture passed parameters in Perl on Windows? In regular perl
>its:
> $variable = param('passed');
Hi Mark,
Erm, are you talking about passing parameters on the command line or to a
cgi.
if you calling pe
Capturing parameters passed to a perl-script on Windows is done using the
special @ARGV variable.
@ARGV can be checked to see how many parameters were passed to your script,
easily by doing so:
die "blah blah blah " unless @ARGV == 2;
This will make your script die with a message unless there we
B. Fongo wrote:
Hello
Please don't cross post
An argument passed to a subroutine returns wrong value.
Code example:
@x = (1..5);
$x = @x;
You are trying to assign an array to a scalar. An array evaluated in a
scalar context gives the no elements present in it. In this case the
value 5 will b
"B. Fongo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello
Hi
>
> An argument passed to a subroutine returns wrong value.
>
> Code example:
>
> @x = (1..5);
> $x = @x;
>
> showValue ($x); # or showValue (\$x);
>
>
> sub showValue {
>
> my $forwarded = @_;
> print $forwa
- Original Message -
From: "B. Fongo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 11:34 AM
Subject: passing an argument to a subroutine
> Hello
>
> An argument passed to a subroutine returns wrong value.
What value do you want it
Babylon wrote:
I know how it's supposed to be done but when i tried it in a program i'm
writing at the moment it isn't working quite how i expected.
The program is, in it's simplest form (which still doesn't work):
--
#!perl
for $file ()
{
push @
Hello
An argument passed to a subroutine returns wrong value.
Code example:
@x = (1..5);
$x = @x;
showValue ($x); # or showValue (\$x);
sub showValue {
my $forwarded = @_;
print $forwarded; # print ${$forwarded};
}
In both cases, the script prints out 1.
What is going on here?
Thanks, I found that but I'm looking for a Perl solution, should be possible with a
one liner regex substitution AFAIK.
Cheers,
Nigel
MIS Web Design
http://www.miswebdesign.com/
> -Original Message-
> From: Toby Stuart [mailto:[EMAIL PROTECTED]
> Sent: 04 September 2003 04:58
> To: 'Nig
I know how it's supposed to be done but when i tried it in a program i'm
writing at the moment it isn't working quite how i expected.
The program is, in it's simplest form (which still doesn't work):
--
#!perl
for $file ()
{
push @ARGV, $file;
Hello
Below is a portion of a script that displays a table. The argument
passed by param() determines the number of rows the table should
display.
For some unknown reason, the value of param() seem to behave strangely.
It at times the value does not change; even if a different number is
sent as
Hello I have 3 weeks learning Perl and I am trying to solve a trouble
I need to write my thesis
I have to read a file where I don't know the content of the first rows
(only strings) and I need to read only data (numbers), I mean, I am going
to read information that begin with blank space
I know how it's supposed to be done but when i tried it in a program i'm
working on at the moment it isn't working quite how i expected.
The program is, in it's simplest form (which still doesn't work):
--
#!perl
for $file ()
{
push @ARG
I cant use Telnet or Sockets because the modules are
not loaded on. I want to automate telnets to a list of
ips.
It looks like this is running but I am not prompted
for a login and password until after I interupt the
script.
How can I get the prompts sent to the display then
return to the per
Oh-oh - there was a mistake - I tried chomp, not chmod..
How do I use chomp correctly? I have an array of strings, want to cut
off the last \n in each line and use the rest of the line. (concatenate
it to another string)
Jane
Hi all!
I like to read several rows out of two different table-files
Hi all!
I like to read several rows out of two different table-files and put
them successively in a new file by:
@ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m];
Anything works fine, except that I can't delete the ending newline in
the lines in the first tables. So t
I think it would be easier to skip the split-function and use substr and
rindex insted. It's shorter code.
#!perl -w
my $path = "C:/program files/directory1/directory2/file.txt";
my $filename = substr($path,(rindex($path,"/")+1));
print $filename;
This code will give you "file.txt" as output.
H
Worked like a charm, big time thanks.
Sincerely in Christ,
Mark-Nathaniel Weisman
President / Owner
Outland Domain Group Consulting
Anchorage / Washington DC / Bellevue
[EMAIL PROTECTED]
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, September 01, 200
How do you capture passed parameters in Perl on Windows? In regular perl
its:
$variable = param('passed');
However, when I tried to run that under windows, it dies a horrible
death? I've looked through perl.org for more information about
converting over my unix scripts to windows, any other goo
1 - 100 of 102 matches
Mail list logo