y that function would do for you. You won't easily come up with a
valid address that would be rejected.
But please note the discussion that followed in that old thread. They
thought I ought to use Email::Valid instead. ;-)
--
Gunnar Hjalmarsson
--
To unsubscribe, e-mail: beginners-unsubscr...@p
the given string.
Can you clarify what you mean by that?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
P
headers automaticly... but I couldn't find such a thing.
Which browser related file size limitations are you talking about?
CGI.pm or CGI::UploadEasy allows you to set the max size to whatever
value you wish.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To
rlish) way to mix two lists in this way.
You can use a hash slice.
@{ $data{$key} }{ @fields } = split /:/, $val;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@
ist of such records, one on each line, and with
identical markup? If not, trying to do it with one substitution is a
crazy idea. If it's a real world thing, you most likely should use an
HTML parser.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Steve Bertrand wrote:
Roman Makurin wrote:
On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote:
Strange.
It looks like strictures and warnings are not enabled (@a and @b are not
declared). Try to add
use strict;
use warnings;
and see if that makes Perl give you a
Roman Makurin wrote:
On Wed, Jun 24, 2009 at 03:02:00AM +0200, Gunnar Hjalmarsson wrote:
Roman Makurin wrote:
use constant {
A => 1,
B => 2,
C => 3 };
@a = (1, 2, 3);
@b = (A, B, C);
# first loop
while(my $i = shift @a) {
print $i, $/
}
# second loop
p work as expected, but
second doesnt.
My questions are: How did you expect the second loop to work, and what
output did you get? (They both "worked" fine for me.)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl
th $newword < length $oldword
? sprintf "%-${length_old}s", $newword
: substr $newword, 0, $length_old;
s/$oldword/$replace/;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additio
Rob Coops wrote:
$text = "2 minutes, and 8 seconds";
$text =~ /(\d{1,2}).*?(\d{1,2}).*/;
-^^
When you are extracting stuff, .* is _always_ redundant in the beginning
or end of a regex.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/
test script was run as
have read access to
/usr/local/lib/perl5/site_perl/5.10.0/x86_64-linux/HTML/Parser.pm ?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
jm wrote:
Gunnar Hjalmarsson wrote:
jm wrote:
seems to be some requirement for html via a module call that's
not necessary in straight perl inline html.
I'm still confused about what the real problem is, but it sounds like
you are on the wrong track. AFAIK, there is no &quo
here is no "straight perl inline
html". HTML is HTML, whether it is on a static page or generated by a
program, e.g. a Perl program.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e
al in both the sub and the main code?
If that is true, you'd better ask W3C. It has nothing to do with Perl.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
loops, but a true for loop is something else.
Can anyone suggest me a good url which can tell the difference between two?
http://perldoc.perl.org/perlsyn.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
Jeff Pang wrote:
We use "wget -p" to get the page and its full dependency.
You could also use LWP but that's complicated to fetch the page and all
its dependency.
I thought that the portable WWW::Mechanize was the way to go rather than
wget when there is a need to follow lin
ible.
By writing a Perl program. Show us what you have so far, let us know
which part(s) of it you find difficult, and somebody may be willing to
help you fix it. Don't expect anybody to write the whole program for you
for free.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/co
opendir(), readdir() and grep().
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Chas. Owens wrote:
On Mon, May 18, 2009 at 19:05, Gunnar Hjalmarsson wrote:
AndrewMcHorney wrote:
I looked at the documentation for this function and I find it confusing.
Try File::Finder for a less confusing interface to *the module* File::Find.
snip
Huh, never looked at File::Finder
AndrewMcHorney wrote:
I looked at the documentation for this function and I find it confusing.
Try File::Finder for a less confusing interface to *the module* File::Find.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr
with cookies, and it's possible that the script
requires one or more cookie to be sent as part of the request.
Those are two obvious things, but there might be more into it. Why not
simply ask them?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
s compiled so it is
*not* re-run every time through the loop." is very wrong.
Yep, that's it. John, honestly I thought that you had made a 'typo', and
that my little snippet would be sufficient to call your attention to it.
--
Gunnar Hjalmarsson
Email: http://www.gunna
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e '
for (1..5) {
my $count;
$count
print "\n";
'
1
$
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
print "There are $count options.\n";
Please study the above and compare it with your attempt and the
HTML::TokeParser docs.
Also, if there are two dropdowns and the second is a dependent of the
first e.g. select size then select availabe colors; how do i count
the total possible combina
question. Just wanted to mention
that you basically do that with references.
perl -le '
$y = "green";
$x = \$y;
$$x = "red";
print $y;
'
red
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
ought to be implicitly localized to the loop.
http://perldoc.perl.org/perlsyn.html#Foreach-Loops
OTOH, I believe it's advisable to always my() declare loop variables,
even if there happens to be a global variable with the same name.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cg
Chas. Owens wrote:
On Fri, May 1, 2009 at 10:18, Gunnar Hjalmarsson
wrote:
I agree that perldiag says all that needs to be said. But a common
way to work with perldiag is to look up cryptic error or warning
messages when needed rather than using the diagnostics pragma.
Unfortunately the
Chas. Owens wrote:
On Wed, Apr 29, 2009 at 19:07, Chas. Owens wrote:
On Wed, Apr 29, 2009 at 18:44, Gunnar Hjalmarsson wrote:
snip
You are encouraged to include a patch also when submitting a bug report - I
did so in the above example, btw - so I still not quite get the distinction.
Are the
Chas. Owens wrote:
On Wed, Apr 29, 2009 at 17:20, Gunnar Hjalmarsson wrote:
Chas. Owens wrote:
2009/4/28 Gunnar Hjalmarsson :
snip
I believe the standard response is "patches are welcome."
Are they? The number of open or "new" bugs at
http://rt.perl.org/rt3/Public/
mak
Chas. Owens wrote:
2009/4/28 Gunnar Hjalmarsson :
snip
I believe the standard response is "patches are welcome."
Are they? The number of open or "new" bugs at http://rt.perl.org/rt3/Public/
makes me fear something else.
( I did submit a bug report a few weeks ago:
ht
nt that it's more into it than just adding the
package name. (Such a hint would have been really useful in my case.)
Though I bet people will be confused in cases like
perl -Mstrict -e 'local $var = 4'
because quite a few people think "local $foo" is a declaration.
Jenda Krynicky wrote:
From: "Chas. Owens"
On Tue, Apr 28, 2009 at 13:38, Gunnar Hjalmarsson wrote:
snip
Fully qualified names do not trip strict. Which is a reason to avoid
using them. I once work at a place that wrote Perl 5 as if it were
still Perl 4. They had turned on stri
t
what Perl requested me to do.
$ perl -Mstrict -e'$var=""'
Global symbol "$var" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.
$
The wording of that error message isn't very well thought out. :(
--
Gunnar
including
use of scripts or web crawlers) and shall ensure that you comply with
the instructions set out in any robots.txt file present on the Services."
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Chas. Owens wrote:
On Wed, Apr 22, 2009 at 15:25, Gunnar Hjalmarsson wrote:
snip
Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html) one
can however make them parsed (decoded) (provided they are valid UTF-8).
No. The utf8 pragma is about allowing UTF-8 encode
"FALSE" here, but uncomment "use utf8" and it gets "TRUE".
Looks like with "use utf8" those string literals aren't ordinary byte
strings anymore. Perhaps they are as if Encode::decode had been applied
to them?
Yes, it seems to be so. Please also see
Gunnar Hjalmarsson wrote:
Stanisław T. Findeisen wrote:
With "use utf8" (http://perldoc.perl.org/utf8.html) one can however
make them parsed (decoded) (provided they are valid UTF-8).
No. The utf8 pragma is about allowing UTF-8 encoded *symbols*, e.g.
variable names or subroutine n
Stanisław T. Findeisen wrote:
Gunnar Hjalmarsson wrote:
What assumptions does Perl make regarding input file (i.e., the
program/script file) encoding?
AFAIK, it just converts the bytes into Perl's internal format, but it
does not assume anything (at least not by default) with respect t
whatever the path is to your 5.6 library)
Could the folks who host my website simply not have the library?
That seems odd. It's kind of basic, isn't it?
Even if libwww-perl is not among the standard modules, I believe it's
included in most Perl distributions.
--
Gunnar Hjalm
Stanisław T. Findeisen wrote:
Gunnar Hjalmarsson wrote:
Stanisław T. Findeisen wrote:
Hi how to write regular expressions matching against Unicode (eg.,
UTF-8) strings?
For instance, in my regexp:
qr/^([.<>@ \w])*$/
Decode the UTF-8 encoded strings before applying the regex o
Adwords::CampaignService
POD say something else. Such mistakes makes me doubt the quality of
those modules.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
R. Hicks wrote:
Are there any gotchas for using qx() to run system commands versus
backticks?
No, it's the same thing.
http://perldoc.perl.org/perlop.html#qx/STRING/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-uns
smörgåsbord";
$s = decode "UTF-8", $utf8_encoded;
print "Match" if $s =~ /^\w+$/;
'
Match
$
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
that I can use in package Amy e.g. Util::foo() or Util->foo()
but then I cannot get the @EXPORT working.
Try
import Util;
instead.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Gunnar Hjalmarsson wrote:
Raheel Hassan wrote:
I am facing problems in executing cgi programs, on Apache web server, can
any body tell me how i can configure my Apache server so that it can
support
CGI and Msql. I also wanted to enable ssl support in the Apache server.
http
http://httpd.apache.org/docs/2.0/ssl/
AFAIK, MySQL is not an HTTP server configuration thing.
(Do you have a Perl question?)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h
Chas. Owens wrote:
On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson wrote:
Chas. Owens wrote:
my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;
my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /;
--^
snip
That depends on who you play with.
Ok.
Also, if you make that change you
Chas. Owens wrote:
my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;
my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /;
--^
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e
earth would you want to do that?
Is that even possible?
I doubt it.
I suggest you check out the Games::Poker::HandEvaluator module at CPAN.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-ma
if that's the reason why the install failed the first time,
but have you installed the htmldoc program?
To retry, I believe you first need to remove the
HTML-HTMLDoc-0.10-8rfFZS directory.
HTH
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mai
:
use LWP::Simple;
my $url = 'http://parent_dir/file';
my $local = '/path/to/local/file';
my $file = getstore($url, $local);
getstore() returns the HTTP status code, so 'file' is not the most
appropriate name of a variable to which the return value is assigned.
--
ANJAN PURKAYASTHA wrote:
I have a file stored at a location: http://parent_dir/file
Which among gazillion LWP options can I use to download and store the file
on my machine?
use LWP::Simple;
getstore('http://parent_dir/file', 'file');
--
Gunnar Hja
perldoc.perl.org/perlsub.html
There is no reason in this case to use the & character, and most Perl
programmers today would say that
which_element_is("dan", @names);
is the preferred 'normal' way to call a function.
(Others have answered the question you asked.)
--
;
open my $fh, '<', $file or die "Opening $file failed: $!";
my @lastnames;
while ( <$fh> ) {
my @line = split /\t/;
chomp @line; # if the record has no further elements
push @lastnames, $line[1];
}
--
Gunnar Hjalmarsson
Email:
2 3',
};
and you are using Data::Dumper to extract values from it when you'd
better just say:
my $nick = $message->{who};
my $str = $message->{body};
Hopefully that hint helps you move forward.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
Rick Bragg wrote:
I need a quick regex to strip out the following:
Never heard of that. What is a quick regex?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h
$
John pointed out one mistake. The other mistake is your use of single
quotes around the ISBN.
$ perl -MBusiness::ISBN -le '
$isbn = Business::ISBN->new("0-59610-206-2");
print $isbn->as_string;
'
0-596-10206-2
$
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cg
Chas. Owens wrote:
There is also the ongoing danger of putting untrusted file names in
@ARGV[4],
$ perl -we "undef @ARGV[4]"
Scalar value @ARGV[4] better written as $ARGV[4] at -e line 1.
$
Maybe your previous footnote style was better after all. ;-)
--
Gunnar Hjalmarsson
E
Randal L. Schwartz wrote:
"Gunnar" == Gunnar Hjalmarsson writes:
Gunnar> Martin Spinassi wrote:
Is there any way to open a file for input and output at the same time?
Gunnar> Yes. Open it with the '+<' MODE.
Gunnar> open my $fh, '+<', $
--/;
push @keep, $_;
}
seek $fh, 0, 0;
truncate $fh, 0;
print $fh @keep;
http://perldoc.perl.org/functions/open.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
ent inside the pair. If that's the
case, it's probably not a disaster if it would fail occasionally, and a
simple substitution may be sufficient:
s,(.+),$1,is
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...
reply).
Sounds pretty safe to me.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Nigel Peck wrote:
Gunnar Hjalmarsson wrote:
Nigel Peck wrote:
I'd appreciate hearing (reading!) people's thoughts on making web
form data safe for using to compose an email via sendmail.
Basically, see comments in pseudo-code below, what should I be doing
to the data to ma
re parameter is intended for the
message headers, there are a few things to consider.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Chas. Owens wrote:
On Sat, Mar 14, 2009 at 17:49, Gunnar Hjalmarsson wrote:
snip
Unfortunately not. I tried again a couple of minutes ago; nothing
downloaded. :(
Well, I'll stick to emails for the time being.
snip
Does the following work?
telnet nntp.perl.org 119
If it does try typin
Randal L. Schwartz wrote:
"Gunnar" == Gunnar Hjalmarsson writes:
Gunnar> The NNTP interface to this list (and possibly other @perl.org lists)
seems not
Gunnar> to work any longer. Does anybody know what the problem is? Is it a
temporary
Gunnar> thing, or has the servi
The NNTP interface to this list (and possibly other @perl.org lists)
seems not to work any longer. Does anybody know what the problem is? Is
it a temporary thing, or has the service been permanently disabled?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To
monnappa appaiah wrote:
Gunnar Hjalmarsson wrote:
monnappa appaiah wrote:
I"m sorry for starting the new threadi tried to
understand the solution but i couldn't understand much from it, i
have used the used eval to trap errors but after that i couldn't
understand as
ing to accomplish is somewhat above your head
for the time being? Maybe you'd better take a step back and improve your
Perl skill?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beg
t the *reason(s)* for the failures. Apply the
solution you were given in the other thread.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
he /g
modifier?
Since I am not using back reference, are there a better way?
I would do:
if ( $a =~ /\.(?:html|jpg)$/i )
Please read http://perldoc.perl.org/perlretut.html and other appropriate
docs.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscri
7, 33, 29, 25, 21, 2,],
},
core2 => {
loopback => [254,],
link_int => ['int1', 'int2', 'int3',],
link_ip => [34, 54, 10, ],
},
core3 => {
loopback => [252,],
link_int => ['int1',
lized value $x in print at C:\home\test.pl line 7.
C:\home>
Unless "no warnings" had been effective, line 5 would also have
generated a warning.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Dr.Ruud wrote:
Gunnar Hjalmarsson wrote:
Dr.Ruud wrote:
Gunnar Hjalmarsson wrote:
eval { $ssh2->connect($_) };
if ($@) {
warn "Unable to connect host $_: $@" and next;
}
That is the "old fashioned" way. You really need to use the return
value of
Dr.Ruud wrote:
Gunnar Hjalmarsson wrote:
monnappa appaiah wrote:
This the error i'm getting
Net::SSH2::connect: failed to connect to 10.10.10.1:22: Unknown error at
connect.pl line 21
the line 21 is shown below
$ssh2->connect($_) or warn "Unable to connect host $_\n"
Gunnar Hjalmarsson wrote:
Dermot wrote:
This will only give you the top level of directories:
07/02/2009 14:00 .
07/02/2009 14:00 ..
07/02/2009 14:00 bin
15/03/2006 22:14 eg
07/02/2009 14:00 html
15/03/2006 22:15
my Perl installation is:\n",
" $bytes bytes\nor\n ", sprintf('%.1f', $bytes/1024**2),
" MiB\n";
C:\home>test.pl
The acc. size of the files in my Perl installation is:
90529266 bytes
or
86.3 MiB
C:\home>
--
Gunnar Hjalmarsson
Email: http://www.gunnar
alue is: value 1/value 2
Comparison 1: 1
Comparison 2: 1
???
So, what behavior exactly is it that you consider weird? What output had
you expected?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
?
Probably a bug in the code. ;-) Which measures have you taken to try to
find the bug?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
rror happens inside Net::SSH2, and warn()
and next() are not run. The standard solution to this problem is eval():
eval { $ssh2->connect($_) };
if ($@) {
warn "Unable to connect host $_: $@" and next;
}
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/c
]*$thehl*$thepare...@array[3]*@array[4]";
$theHL = $theHL + 1;
}
}
$line =~ s/$/~/;
if ($line ne "~\n") {
print TOFILE $line;
}
Missing right curly to end the while loop.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
/[[:^ascii:]]/;
my @parts;
while ( $str =~ /(.{1,40}.*?(?:\s|$))/g ) {
my $part = $1;
push @parts, MIME::QuotedPrint::encode($part, '');
}
join "\r\n\t", map { "=?$enc?Q?$_?=" } @parts;
}
The resulting
Jerald Sheets wrote:
Gunnar Hjalmarsson wrote:
Jerald Sheets wrote:
In your code you can specify the directory location of the pm:
use lib '/path/to/pm';
That makes no sense. It would cause Perl to look for
/path/to/pm/XML/Handler/YAWriter.pm
and the module would not be fou
Jerald Sheets wrote:
In your code you can specify the directory location of the pm:
use lib '/path/to/pm';
That makes no sense. It would cause Perl to look for
/path/to/pm/XML/Handler/YAWriter.pm
and the module would not be found.
--
Gunnar Hjalmarsson
Email: http://www.gun
ramesh.marimu...@wipro.com wrote:
How to set env variable? I'm using PERL in WINDOWS.
My question phrasing may be wrong.
Actually my question is I need to run Perl from anywhere from my system.
s/env variable/PATH/
Type
help path
--
Gunnar Hjalmarsson
Email: http://www.gunn
sys...@wowway.com wrote:
I'm trying to use an XML pretty printer called xmlpretty ...
http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/5407c504591e0c4e
Do not multi-post!!
http://lipas.uwasa.fi/~ts/http/crospost.html
--
Gunnar Hjalmarsson
Email: http://www.gunn
x27;s another way to say:
last if lc $normal eq 'yes' or lc $normal eq 'no';
http://perldoc.perl.org/functions/grep.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
-^^^^^^
Use print(), not printf().
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
ngs;
use strict;
use constant {
MY_FIRST_CONSTANT => 'hello world!'
};
use Exporter;
our @EXPORT = qw/MY_FIRST_CONSTANT
$MY_SECOND_CONSTANT
routine1
/;
#...@export_ok would be better
In this case there is only one package. Would you still bother with
Chas. Owens wrote:
On Fri, Feb 27, 2009 at 11:07, Gunnar Hjalmarsson wrote:
Sarsamkar, Paryushan wrote:
I would like to accept some user inputs (using ), but it might be
easier for a user if I can provide the default value, so that they just
have to press ENTER.
How can I do that? I
.g.
Do you want to do the normal thing? [yes] :
print 'Do you want to do the normal thing? [yes] : ';
chomp( my $normal = );
$normal ||= 'yes';
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
use 'join' to create a CSV output line?
Yes.
my $line = join ',', @{ $record[0] };
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
"5"}};
Any special reason why you say
my %files = %{{ ... }};
instead of simply
my %files = ( ... );
?
While this suggestion is inefficient, it takes less typing compared to
other postings:
my $max = ( sort { $files{$b} <=> $files{$a} } keys %files )[0];
--
Gunnar
about using CPAN module Net::SCP -
http://search.cpan.org/~ivan/Net-SCP-0.08/SCP.pm
I am not able to use any module .
That sounds like an unusual form of disability. Why do you want to use
Perl then?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/cont
"\tMIME type: $info->{$file}{mimetype}\n",
"\tSize: $info->{$file}{bytes}\n\n";
}
Please see http://search.cpan.org/perldoc?CGI::UploadEasy for further
guidance.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail:
msg => $msg,
} ) ) ) {
print "Message was sent.\n";
last;
} else {
warn "Send attempt $try. $sender->{'error_msg'}\n";
$try == 4 ? die 'I give up' : sleep 10;
}
}
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Octavian Râs,nit,a( wrote:
From: "Gunnar Hjalmarsson"
This is an example program where "use utf8;" makes a difference:
use utf8;
$igår = '2009-02-24';
print "Yesterday: $igår\n";
("igår" is Swedish for "yesterday"
[ new attempt - encoding is tricky... ]
Gunnar Hjalmarsson wrote:
Octavian Râsnita wrote:
If I used it in a UTF-8 encoded perl program and was also using "use
utf8;" in it, I expected that it understand that it should be encoded
to UTF-8.
I don't think that's what the
1 - 100 of 918 matches
Mail list logo