On Tue, Feb 7, 2012 at 12:49 PM, Parag Kalra wrote:
>
>
> On Mon, Feb 6, 2012 at 8:35 PM, lina wrote:
>>
>> until ($name eq "");
>> do {
>> print "Enter another name, or Enter to stop:\n" ;
>> $name = ;
>> chomp ($name);
>> push @namelist,$name;
>>
>> }
>>
>> print @na
On Mon, Feb 6, 2012 at 8:35 PM, lina wrote:
> until ($name eq "");
> do {
>print "Enter another name, or Enter to stop:\n" ;
>$name = ;
>chomp ($name);
>push @namelist,$name;
>
> }
>
> print @namelist
>
This should work. Also start using strict and warnings pragma
#/usr/bin/perl
until ($name eq "");
do {
print "Enter another name, or Enter to stop:\n" ;
$name = ;
chomp ($name);
push @namelist,$name;
}
print @namelist
$ ./generate_namelist.pl
./generate_namelist.pl: line 6: syntax error n
At 11:10 AM -0700 5/26/11, Derek wrote:
Hello, I am getting the following error:
bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
unexpected token `('
bash: /var/www/html/bugzilla/email_in.pl: line 2: `use Cwd
qw(abs_path);'
The contents of this file are:
#!/us
B
On Sat, May 28, 2011 at 12:10 PM, Uri Guttman wrote:
> >>>>> "D" == Derek writes:
>
> D> Hello, I am getting the following error:
> D> bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
> D> unexpected token `('
&
>>>>> "D" == Derek writes:
D> Hello, I am getting the following error:
D> bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
D> unexpected token `('
big clue. what is the first word of that line? it is bash! perl is not
seeing your
Hello, I am getting the following error:
bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
unexpected token `('
bash: /var/www/html/bugzilla/email_in.pl: line 2: `use Cwd
qw(abs_path);'
The contents of this file are:
#!/usr/bin/perl
use Cwd qw(abs_path);
Thats a
s ($@);
>
>
> I use:
>
> if (not $@) {return 1;}
>
>
>
> OR
>
> return 1 if (not $@);
>
>
>
> the syntax error does not get printed out. I assumed that these statements
> were logically equal, so, what gives?
I'm not sure. As Ruud mentioned, the
On 2010-10-01 04:37, Jon Hermansen wrote:
sub is_valid_xml {
my ($content) = @_;
eval {
my $xs = XML::Simple->new();
my $ref = $xs->parse_string($content);
};
return 1 unless ($@);
}
Don't test the truth of $@, but use the return value of the eval.
my $ret = eval {
> my $xs = XML::Simple->new();
> my $ref = $xs->parse_string($content);
> 1; # ensure true value if no fatalities
> };
> return $ret;
> }
>
> then just call the sub in scalar context and
> check for an er
then just call the sub in scalar context and
check for an error:
is_valid_xml( "blah") or die "invalid: $@";
> and when I pass in 'blahblahblah' as an argument, I get:
>
> syntax error at line 1, column 0, byte 0 at /usr/lib/perl5/XML/Parser.pm
>
&g
hblahblah' as an argument, I get:
syntax error at line 1, column 0, byte 0 at /usr/lib/perl5/XML/Parser.pm
> line 187
I would like to trap this syntax error, but don't know how. I've tried each
of these statements individually:
local $SIG{'__DIE__'};
> local $SIG{
On Aug 23, 4:36 pm, [EMAIL PROTECTED] (Randal L. Schwartz) wrote:
> > ""[EMAIL PROTECTED]" == "[EMAIL PROTECTED] com" <[EMAIL PROTECTED]>
> > writes:
>
> "[EMAIL PROTECTED]> Those three things look like sets (unordered) to me not
> lists
> "[EMAIL PROTECTED]> (ordered). The natural dataty
> ""[EMAIL PROTECTED]" == "[EMAIL PROTECTED] com" <[EMAIL PROTECTED]>
> writes:
"[EMAIL PROTECTED]> Those three things look like sets (unordered) to me not
lists
"[EMAIL PROTECTED]> (ordered). The natural datatype in Perl to represent a set
of strings
"[EMAIL PROTECTED]> is a hash with
Hello Paul,
Wednesday, August 22, 2007, 3:21:06 PM, you wrote:
> On Aug 22, 1:18 am, [EMAIL PROTECTED] (Alexandru Maximciuc)
> wrote:
>> Wednesday, August 22, 2007, 7:44:02 AM, you wrote:
>>
>> > unless (grep $item eq $_, %$all_ref{$crew}) {
>>
>> this does the job well (I
On Aug 22, 6:18 am, [EMAIL PROTECTED] (Alexandru Maximciuc)
wrote:
> Hello Chris,
>
> Wednesday, August 22, 2007, 7:44:02 AM, you wrote:
>
> > I am working a script that is a solution to a problem in Intermediate
> > Perl. Here is the script:
> > #!/usr/bin/perl -w
> > use strict;
> > sub check_it
On Aug 22, 1:18 am, [EMAIL PROTECTED] (Alexandru Maximciuc)
wrote:
> Wednesday, August 22, 2007, 7:44:02 AM, you wrote:
>
> > unless (grep $item eq $_, %$all_ref{$crew}) {
>
> this does the job well (I think :) )
> unless (grep $item eq $_, $all_ref->{$crew}) {
No. $all_re
On Aug 22, 12:50 am, [EMAIL PROTECTED] (Yitzle) wrote:
> http://perldoc.perl.org/functions/grep.html
Good advice. Irrelevant to the problem at hand, but good advice
nonetheless.
> Without testing the code or anything, could it be that:
> unless (grep $item eq $_, %$all_ref{$crew}) {
>
> should b
> my @professor = qw(sunscreen water_bottle slide_rule batteries radio);
>
> my %all = (
> Gilligan => [EMAIL PROTECTED],
> Skipper => [EMAIL PROTECTED],
> Professor => [EMAIL PROTECTED],
> );
>
> check_items_for_all(\%all);
>
> When I ru
rofessor => [EMAIL PROTECTED],
);
check_items_for_all(\%all);
When I run the script, I get the following error message:
syntax error at required_items.pl line 13, near "$all_ref{"
syntax error at required_items.pl line 18, near "}"
I'm not sure what is causing this. E
On Aug 22, 5:44 am, [EMAIL PROTECTED] (Chris) wrote:
> I am working a script that is a solution to a problem in Intermediate
> Perl. Here is the script:
>
> #!/usr/bin/perl -w
> use strict;
>
> sub check_items_for_all {
> my $all_ref = @_;
> my @who = keys %$all_ref;
>
> my
On Aug 22, 5:44 am, [EMAIL PROTECTED] (Chris) wrote:
> my @gilligan = qw(red_shirt hat lucky_socks water_bottle);
> my @skipper = qw(blue_shirt hat jacket preserver sunscreen);
> my @professor = qw(sunscreen water_bottle slide_rule batteries radio);
>
> my %all = (
> Gilligan => [EMAIL PRO
essor => [EMAIL PROTECTED],
> );
> check_items_for_all(\%all);
> When I run the script, I get the following error message:
> syntax error at required_items.pl line 13, near "$all_ref{"
> syntax error at required_items.pl line 18, near "}"
> I'm n
; my %all = (
> Gilligan => [EMAIL PROTECTED],
> Skipper => [EMAIL PROTECTED],
> Professor => [EMAIL PROTECTED],
> );
>
> check_items_for_all(\%all);
>
> When I run the script, I get the following error message:
> syntax error at required_
llowing error message:
syntax error at required_items.pl line 13, near "$all_ref{"
syntax error at required_items.pl line 18, near "}"
I'm not sure what is causing this. Eventually, I want the script to
access each crew member's belongings, figure out which of the items i
; beginners@perl.org
Subject: RE: syntax error of some sort?
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to u
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to use
$_[0]
Second Value means
$_[1] and so on..
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to use
$_[0]
Second Value means
$_[1] and so on..
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Heh, I am running out of hair:P
I get two errors to start, one is the warning that is better write:
my ($vm) = $_[0];
instead of
my ($vm) = @_[0];
The proper way to say this is
my ($vm) = @_;
And looking at your data I would suggest
my (
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Heh,
Clearly I need to sleep!
This doesn't even work either?
#!/usr/bin/perl -w
@list = (Exchange,Filter,DNS,Domain)
snip
You are missing your quotes.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Heh,
Clearly I need to sleep!
This doesn't even work either?
#!/usr/bin/perl -w
@list = (Exchange,Filter,DNS,Domain)
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
What is wrong here?
jlc
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Heh, I am running out of hair:P
I get two errors to start, one is the warning that is better write:
my ($vm) = $_[0];
instead of
my ($vm) = @_[0];
And the other is about the use of the global @_ (huh) with "my"?
I have this now:
#!/usr/bin/perl -w
@Exchange = ("/vmfs/volumes/467f06a5-7d59c067-35
OK Chase,
I saw the missing quotes:)
I sniped out the later work using the other elements of the array as to much
was broken! I do want to pass in an array and work with all of it.
So if I wanted to work with only the first indices to start, is this correct:
sub stop_it {
my ($vm) = @_[0];
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
snip
Is it actually incorrect to run: stop_it(@DNS); aside from maybe looking
strange?
snip
It doesn't look strange, but your code only works with the first
element of @DNS so it is pointless. If you want to say stop_it(@DNS)
and actually
?
So the `/usr/bin/vmware-cmd \"$_[0]\" gettoolslastactive -q`; is correct where
the var gets inserted?
Thanks!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 8:15 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: synta
On 7/4/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
snip
> The second I am sure is the darn () in the file names I am feeding
> into the function. Can someone shed some light :) I need to call the
> first indices of many arrays that get passed into this function, so I
> was thinking $_[0] was w
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
snip
if ($state == 'on') {
'vmware-cmd $_[0] stop soft';
my $tools = `/usr/bin/vmware-cmd \"$_[0]\"
gettoolslastactive -q`;
chomp
I have the following code (it's a snippet so it may seem silly, but altogether
it would make sense as I am forcing one array into it for a test):
#!/usr/bin/perl -w
@DNS = ("/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/Web & DNS (Win2003
Std x32)/Web & DNS (Win2003 Std
x32).vmx","/vmfs/vol
AndrewMcHorney wrote:
> Hello
Hello,
> I do not have my perl books with me and so I cannot diagnose the error I
> am getting with several if statements. Could someone assist?
Do you have the Perl documentation installed on your hard drive?
perldoc perldiag
> Here is the code:
>
> #! /bin/per
On 9/9/06, AndrewMcHorney <[EMAIL PROTECTED]> wrote:
I do not have my perl books with me and so I cannot diagnose the
error I am getting with several if statements.
What line is the error? What's the error message? Can you find the
message in perldiag?
if (file_deleted[compare_index] ==
Hello
I do not have my perl books with me and so I cannot diagnose the
error I am getting with several if statements. Could someone assist?
Here is the code:
#! /bin/perl
#
# Create the files to delete list file
#
#
# Find all the files
#
print "Extracting files in directory";
@file_list =
On Sep 3, [EMAIL PROTECTED] said:
Actually the problem is like this @lookup_datatype = qw ( string(30)
string (40) string(10) Real string(10) Integer string(34) );
when my loop encounters this real or Integer or any other element in the
array it gives a error problem I want to skip through th
Consultancy Services Limited
Ph:- 044-5816
Cell:- 9283199460
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]>
09/03/2005 12:31 AM
To
[EMAIL PROTECTED]
cc
beginners@perl.org
Subject
Re: syntax Error ..
On Sep 3, [EMAIL
On Sep 3, [EMAIL PROTECTED] said:
foreach my $i (0 ..$#lookup_datatype){
my $plus;
($plus) = /([0-9]+)/ , $lookup_datatype[$i];
I think you want
($plus) = $lookup_datatype[$i] =~ /([0-9]+)/;
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Saturday, September 03, 2005 12:20 AM
Subject: syntax Error ..
>
> Hi Guys...
>
> Can u plz give me the write syntax for
> this
>
> foreach (@lookup_datatype){
> my $plus;
>
Hi Guys...
Can u plz give me the write syntax for
this
foreach (@lookup_datatype){
my $plus;
($plus) = /([0-9]+)/;
print "$plus\n";
}
in this form..
foreach my $i (0 ..$#lookup_datatype){
my $plus;
($plus) = /([0-9]+)/ , $lookup_datatype[$i];
print "$plus\n";
> [EMAIL PROTECTED] ./summer.pl
> Bareword found where operator expected at ./summer.pl line 78, near "print
> SENDMAIL "TO"
> (Might be a runaway multi-line "" string starting on line 77)
> (Do you need to predeclare print?)
> syntax error at ./
t;not ready" and sends an e-mail notification to the sysadmin detailing the
process id and service name that matched the string "not ready". However,
the script produce the following syntax error below, when it comes to the
SENDMAIL part in the sub-routine sendMail:
[EMAIL PR
Ummm...Are you sure that isn't C?
-Original Message-
From: Robert Larmon
To: [EMAIL PROTECTED]
Sent: 8/1/02 3:10 PM
Subject: newbie syntax error - Perl 4 -> Perl 5.6.1
Okay, so I'm a total Perl newbie. I have an old script (that I
unfortunately inherited) that I'd
on Thu, 01 Aug 2002 22:10:41 GMT, [EMAIL PROTECTED] (Robert
Larmon) wrote:
> Okay, so I'm a total Perl newbie. I have an old script (that I
> unfortunately inherited) that I'd like to convert to Perl 5. I
> copied it over, and I get a syntax error. I went to perl.org,
&g
Okay, so I'm a total Perl newbie. I have an old script (that I
unfortunately inherited) that I'd like to convert to Perl 5. I copied
it over, and I get a syntax error. I went to perl.org, perl.com, etc.,
but can't find anything that describes the differences between 4 and 5.
]
Subject: Re: Syntax error in Win32:CopyFile()
on Thu, 11 Jul 2002 19:47:35 GMT, Rupert Heesom wrote:
> I'm stuck again!
>
> "C:\Perl\TIFFPDF>perl -d tiffpdf.pl
> usage: Win32::CopyFile($from, $to, $overwrite) at tiffpdf.pl line 39,
> line 6."
>
> The code
on Thu, 11 Jul 2002 19:47:35 GMT, Rupert Heesom wrote:
> I'm stuck again!
>
> "C:\Perl\TIFFPDF>perl -d tiffpdf.pl
> usage: Win32::CopyFile($from, $to, $overwrite) at tiffpdf.pl line 39,
> line 6."
>
> The code line is: Win32::CopyFile $CurrTIFFDir."\\".$_.".tif",
> $WorkDir."\\ImageMagick";
Hi all:
I'm stuck again!
I'm trying to copy a file using Win32::CopyFile, and the ActiveState
debugger actually lets me run the script without complaining Until I get
to the "said" line!
The "stdout" error I get is:
"C:\Perl\TIFFPDF>perl -d tiffpdf.pl
usage: Win32::CopyFile($from, $to, $o
- Original Message -
From: "Adrian Farrell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 5:25 PM
Subject: invisible syntax error
> hi,
>
> I simply wished to strip out all the ">" from a text file. below is the
> while (){
> if(S/\>//){
'>' does not have to be escaped (this is not an error, it is the capitalized s as you
mentioned)
You can just write this as s/>//.
$_ = a>a>a>a>';
s/>//g;
print "$_\n";
This prints
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
> hi,
>
> I simply wished to strip out all the ">" from a text file. below is the
> script and the error that is reported. I cannot see anything wrong, it's
> such a simple piece of code! can any one help, are my eyes deceiving me?
[localhost:~] tor% perl -e 'while(<>) {s/\>//g; print;}'
>>
oops, ignore last mail, having one of those days, there was an accidental
capitalization :}
_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--
To unsubscribe, e-mail:
uot;letter.txt") || die "can't open file: $!";
open(OUTPUT, ">newletter.txt");
while (){
if(S/\>//){
print OUTFILE;
}
}
C:\>perl clean.pl
syntax error at clean.pl line 7, near "\>"
syntax error at clean.p
> -Original Message-
> From: Jaishree Rangaraj [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 10:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Syntax error
>
>
>
> Hello All:
>
> Can anybody please tell me if this syntax is corect. I am
>
Hello All:
Can anybody please tell me if this syntax is corect. I am getting syntax error in
this block.
foreach $sorted_field (@sorted_fields) {
if ($Config{'print_blank_fields'} || $Form{$sorted_field})
{
$_=$sorted_field;
"Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mar 27, Wytch said:
>
> >Transliteration replacement not terminated at dot.pl line 18.
> >
> >What is a Transliteration replacement?
>
> First, you've shown us NO code, so we can't help co
On Mar 27, Jeff 'japhy' Pinyan said:
>So it sounds like you've used the tr/// operator and failed to close it
>properly.
Or the y/// operator.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.o
On Mar 27, Wytch said:
>Transliteration replacement not terminated at dot.pl line 18.
>
>What is a Transliteration replacement?
First, you've shown us NO code, so we can't help correct your code.
Second, you should check the error documentation:
% perldoc perldiag
and look for "Transliterat
do you have a =~ tr/// in there somewhere?
-Original Message-
From: Wytch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 1:13 PM
To: [EMAIL PROTECTED]
Subject: what does this syntax error mean?
Transliteration replacement not terminated at dot.pl line 18.
???
What is a
Transliteration replacement not terminated at dot.pl line 18.
???
What is a Transliteration replacement?
Anyone???
=O) Wytch
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
7;switch' - documented in the
> 'perlsyn' perldoc. There is no 'case' or 'switch' function, but you can
> emulate it with a block & exit routine, as documented.
>
> Jason
>
> ----- Original Message -
> From: "Sparkle Williams
--- Michael Fowler <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote:
> > I'm having two problems
> > 1) Is there an equivalent of the case function in Perl?
>
> perldoc -q switch, or
Check out Damian Conway's Switch module.
http://search.cpan.org/doc
On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote:
> I'm having two problems
> 1) Is there an equivalent of the case function in Perl?
perldoc -q switch, or
http://www.perldoc.com/perl5.6/pod/perlfaq7.html#How%20do%20I%20create%20a%20switch%20or%20case%20statement%3f
> $ftp = Ne
Sparkle Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 9:43 AM
Subject: Perl-case statement, and module syntax error
> I'm having two problems
> 1) Is there an equivalent of the case function in Perl?
>
> 2)I'm also gettin
I'm having two problems
1) Is there an equivalent of the case function in Perl?
2)I'm also getting a syntax error for the following part of my program that
I'm attempting to run on my Unix system. I get a syntax error message for
'new($url, ', 'login($username
71 matches
Mail list logo