siegfried wrote:
I posted this on the news group comp.lang.perl yesterday and since I have
not received a response (and it does not look very active) I am cross
posting it here.
This works:
@p= split "\\.", @ARGV[0];
That is usually written as:
@p = split /\./, $ARGV[0];
Why use an array sl
> "s" == siegfried writes:
s> I posted this on the news group comp.lang.perl yesterday and since I have
s> not received a response (and it does not look very active) I am cross
s> posting it here.
that group was removed over a decade ago. your news feed shouldn't even
have it. the gro
I posted this on the news group comp.lang.perl yesterday and since I have
not received a response (and it does not look very active) I am cross
posting it here.
This works:
@p= split "\\.", @ARGV[0];
print "$p[0]\n"
I want to write it as a onliner. How so I do that? Here is my attempt:
At 11:26 PM -0400 9/30/10, Mark wrote:
On 9/30/10 10:59 PM, Chas. Owens wrote:
The only thing I can do to reproduce what you are seeing is to place a
control-d (aka ASCII character 4) in the file. Try saying this
echo 'print "hello\n"' | perl -
If that works, then try this:
perl -nle 'print
On Thu, Sep 30, 2010 at 23:21, Mark wrote:
> On 9/30/10 10:59 PM, Chas. Owens wrote:
>>
>> The only thing I can do to reproduce what you are seeing is to place a
>> control-d (aka ASCII character 4) in the file. Try saying this
>>
>> echo 'print "hello\n"' | perl -
>>
>> If that works
>
> It
On Thu, Sep 30, 2010 at 8:34 PM, C.DeRykus wrote:
> On Sep 30, 7:37 pm, jon.herman...@gmail.com (Jon Hermansen) wrote:
> > Hey all,
> > I have this block of code:
> >
> > sub is_valid_xml {
> >
> > > my ($content) = @_;
> >
> > > eval {
> > > my $xs = XML::Simple->new();
> > >
On Sep 30, 5:19 am, irfan_sayed2...@yahoo.com (Irfan Sayed) wrote:
> Hi,
>
> I am using net::ssh module of Perl to connect to remote machine and execute
> some
> remote commands
> i can connect using user-name and password hard coded in the script like
> below:
>
> #!/usr/local/bin/perl
>
> use s
Thats ^M character.
You can get rid of them using vi: :%s/^M//g
Cheers,
Parag
On Thu, Sep 30, 2010 at 8:26 PM, Mark wrote:
> On 9/30/10 10:59 PM, Chas. Owens wrote:
>
>> The only thing I can do to reproduce what you are seeing is to place a
>> control-d (aka ASCII character 4) in the file.
On Sep 30, 7:37 pm, jon.herman...@gmail.com (Jon Hermansen) wrote:
> Hey all,
> I have this block of code:
>
> sub is_valid_xml {
>
> > my ($content) = @_;
>
> > eval {
> > my $xs = XML::Simple->new();
> > my $ref = $xs->parse_string($content);
> > };
>
> > return 1
Hi everyone, could use some advice on a perl script I wrote using hashes. I
have three files ( each file is a list of indexes) my program loads these
indexes into hashes and compares the differences and similarities between
them. With smaller files it runs fine. problem is I now files have about 88
On 9/30/10 10:59 PM, Chas. Owens wrote:
The only thing I can do to reproduce what you are seeing is to place a
control-d (aka ASCII character 4) in the file. Try saying this
echo 'print "hello\n"' | perl -
If that works, then try this:
perl -nle 'print for grep { $_< 31 or $_> 126 } map or
On 9/30/10 10:59 PM, Chas. Owens wrote:
The only thing I can do to reproduce what you are seeing is to place a
control-d (aka ASCII character 4) in the file. Try saying this
echo 'print "hello\n"' | perl -
If that works
It did.
then try this:
perl -nle 'print for grep { $_< 31 or $_>
On Thu, Sep 30, 2010 at 22:48, Mark wrote:
> On 9/30/10 10:32 PM, Chas. Owens wrote:
>>
>> That is very odd, it should be working. Just to make sure it is not
>> some weirdness with iTerm (I use iTerm, so that shouldn't be the
>> problem), try using Apple's Terminal.app instead.
>
> Same result
On 9/30/10 10:32 PM, Chas. Owens wrote:
That is very odd, it should be working. Just to make sure it is not
some weirdness with iTerm (I use iTerm, so that shouldn't be the
problem), try using Apple's Terminal.app instead.
Same result in Terminal.app.
Also, I have Debian-Lenny running in Vir
On 9/30/10 10:38 PM, Parag Kalra wrote:
Few questions/suggestions:
Which shell are you on? i.e echo $SHELL
/bin/bash
whats the location of the perl binary: i.e which perl
/usr/bin/perl
Can you invoke the program using 'use strict' and let us know the output
I've edited the test.
Few questions/suggestions:
Which shell are you on? i.e echo $SHELL
whats the location of the perl binary: i.e which perl
Can you invoke the program using 'use strict' and let us know the output
Can you try this: perl -e 'print "Hello World"'
Cheers,
Parag
On Thu, Sep 30, 2010 at 7:25 PM, Mark
Hey all,
I have this block of code:
sub is_valid_xml {
> my ($content) = @_;
>
> eval {
> my $xs = XML::Simple->new();
> my $ref = $xs->parse_string($content);
> };
>
> return 1 unless ($@);
> }
>
and when I pass in 'blahblahblah' as an argument, I get:
syntax err
On Thu, Sep 30, 2010 at 22:25, Mark wrote:
> Hi. Perl newbie here. I'm on a MBP using Leopard (10.5.8). Perl is
> pre-installed: /usr/bin/perl.
>
> I can't get a simple "Hello world" script to work. Here's the script (saved
> as test.pl).
>
> #!/usr/bin/perl -w
> print "Hello world!\n";
>
>
Hi. Perl newbie here. I'm on a MBP using Leopard (10.5.8). Perl is
pre-installed: /usr/bin/perl.
I can't get a simple "Hello world" script to work. Here's the script
(saved as test.pl).
#!/usr/bin/perl -w
print "Hello world!\n";
Permissions are set to 755. In a terminal application
Rob Dixon wrote:
John; please listen?
??
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl
John; please listen?
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-m
From: "venkates"
> Hi all,
>
> I have written a piece of code which takes in to list of terms and
> retrieves the intersection between the two list of terms. The code works
> fine but it the intersection list has redundant in its terms. How do I
> fix this? The code is given below.
Try this:
venkates wrote:
Hi all,
Hello,
I have written a piece of code which takes in to list of terms and
retrieves the intersection between the two list of terms. The code works
fine but it the intersection list has redundant in its terms. How do I
fix this?
perldoc -q intersection
The code is
On 10-09-30 10:56 AM, venkates wrote:
I have written a piece of code which takes in to list of terms and
retrieves the intersection between the two list of terms. The code works
fine but it the intersection list has redundant in its terms. How do I
fix this? The code is given below.
See `perldo
Hi all,
I have written a piece of code which takes in to list of terms and
retrieves the intersection between the two list of terms. The code works
fine but it the intersection list has redundant in its terms. How do I
fix this? The code is given below.
#!/usr/bin/perl -w
use Carp;
use stri
-Original Message-
>From: Owen Chavez [mailto:owen.chavez314...@gmail.com]
>Sent: Thursday, September 30, 2010 2:41 AM
>To: beginners@perl.org
>Subject: Alternative to while ()
>
>Hey y'all,
>
>I suspect that I'm struggling with something that has a *really*
>straightforward alternative, b
Hi,
I am using net::ssh module of Perl to connect to remote machine and execute
some
remote commands
i can connect using user-name and password hard coded in the script like below:
#!/usr/local/bin/perl
use strict;
use Net::SSH::Perl;
my $host="dna-ci2.data.corp.sp1.xxx.com";
my $cmd="ls";
my
27 matches
Mail list logo