ure.
Bests,
Jonathan
On Tuesday, February 2, 2016, Frank Vino wrote:
> Hi Andrew,
>
> I felt bad the way he used the language and i am leaving from this
> community...Thanks for all your help!
>
> -Frank
>
>
> On Mon, Feb 1, 2016 at 8:42 PM, Andrew Solomon >
to file handles is
the immediate future.
Thanks,
Jonathan
On Fri, Jan 29, 2016 at 10:45 AM, Shlomi Fish
wrote:
> Hi Jonathan,
>
> On Thu, 28 Jan 2016 17:57:19 +
> Jonathan Harris via beginners wrote:
>
> > Hi,
> > I found that this works, assuming that the mo
to adding the Environment Variable:
http://perlmaven.com/how-to-change-inc-to-find-perl-modules-in-non-standard-locations
Good luck!
Jon
On Fri, Jan 29, 2016 at 4:08 AM, Frank Vino wrote:
> Hi Jonathan,
>
> I am using Windows OS i tried but i got some error message i am attaching
&
Hi,
I found that this works, assuming that the module is installed.
#!/usr/bin/perl
use warnings;
use strict;
use File::Slurp qw ( :edit );
#
my $file_to_edit = 'path-to-file.txt';
#
my $word_to_edit = "Debug";
my $new_word = "Error";
#
edit_file { s/$word_to_edit/$new_word/g } ( $file_to_edit );
so I took the advice seriously.
Hope this helps.
Bests,
Jonathan
On Thursday, March 12, 2015, Frank Vino wrote:
> Activeperl or Strawberry Perl. = Which is good to use?
>
> -Frank
>
On Wed, Apr 10, 2013 at 12:02 PM, Jenda Krynicky wrote:
> From: Jonathan Harris
> > As it seems that Win32::Process::KillProcess is having difficulties
> killing
> > a hanging process, I thought that it would probably make sense to ask the
> > system to do it directl
On Tue, Apr 9, 2013 at 11:15 PM, Mike Flannigan wrote:
>
> On 4/9/2013 6:10 AM, Jonathan Harris wrote:
>
>> Hi All
>>
>> I am using Strawberry Perl (latest release) on a Windows 2003 SP2 server
>>
>> I am trying to use a script to look at running process
On Tue, Apr 9, 2013 at 5:42 PM, Jonathan Harris wrote:
>
>
>
> On Mon, Apr 8, 2013 at 4:41 PM, Jonathan Harris
> wrote:
>
>> Hi All
>>
>> I am using Strawberry Perl (latest release) on a Windows 2003 SP2 server
>>
>> I am trying to use a
On Mon, Apr 8, 2013 at 4:41 PM, Jonathan Harris wrote:
> Hi All
>
> I am using Strawberry Perl (latest release) on a Windows 2003 SP2 server
>
> I am trying to use a script to look at running processes, look for a
> specific process, and kill that process if it is alive for mor
Hi All
I am using Strawberry Perl (latest release) on a Windows 2003 SP2 server
I am trying to use a script to look at running processes, look for a
specific process, and kill that process if it is alive for more than 4
minutes as this would mean that the process has hung
When testing killing No
On Sat, Dec 31, 2011 at 4:29 AM, John W. Krahn wrote:
> Igor Dovgiy wrote:
>
>> Great work, Jonathan!
>> Notice how simple your script has become - and that's a good sign as well
>> in Perl. :) We can make it even simpler, however.
>>
>> As you probabl
On Fri, Dec 30, 2011 at 7:11 PM, Brandon McCaig wrote:
> On Thu, Dec 29, 2011 at 03:43:19PM +0000, Jonathan Harris wrote:
> > Hi All
>
> Hello Jonathan:
>
> (Disclaimer: I stayed up all night playing Skyrim and am running
> on about 4.5 hours of sleep.. ^_^)
>
> I
mes instead into a list
> (with glob operator, for example), and process this list after.
>
> BTW (to Jonathan), I wonder do you really need to store this kind of data
> in different files? No offence... but I can hardly imagine how this data
> will be used later unless g
On Fri, Dec 30, 2011 at 12:33 AM, Jonathan Harris
wrote:
>
>
> On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn wrote:
>
>> Jonathan Harris wrote:
>>
>>>
>>> Hi Igor
>>>
>>> Many thanks for your response
>>>
>>> I h
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn wrote:
> Jonathan Harris wrote:
>
>>
>> Hi Igor
>>
>> Many thanks for your response
>>
>> I have started reviewing the things you said
>> There are some silly mistakes in there - eg not using cl
On Thu, Dec 29, 2011 at 5:08 PM, Igor Dovgiy wrote:
> Hi Jonathan,
>
> Let's review your script a bit, shall we? )
> It's definitely good for a starter, but still has some rough places.
>
> #!/usr/bin/perl
>> # md5-test.plx
>> use warnings;
>> us
;new->addfile($fh)->hex digest;
print "Hex Digest: ", $hex, "\n\n";
print $wr_fh $hex, "\n", $bytes, "\n\n";
return($hex);
close $wr_fh;
close $fh;
}
}
# The following is mostly not original code - thanks to the author!
sub cleanup {
my @filelist = readdi
On Mon, Dec 19, 2011 at 8:09 PM, Shlomi Fish wrote:
> Hi Jonathan,
>
> some comments on your code - both positive and negative.
>
> On Mon, 19 Dec 2011 19:32:10 +
> Jonathan Harris wrote:
>
> > Hi Perl Pros
> >
> > This is my first call for help
&g
On Mon, Dec 19, 2011 at 8:08 PM, Jim Gibson wrote:
> On 12/19/11 Mon Dec 19, 2011 11:32 AM, "Jonathan Harris"
> scribbled:
>
> > Hi Perl Pros
> >
> > This is my first call for help
> >
> > I am a totally new, self teaching, Perl hopeful
>
Hi Perl Pros
This is my first call for help
I am a totally new, self teaching, Perl hopeful
If my approach to this script is simply wrong, please let me know as it
will help my learning!
The script aims to:
1) Read in a directory either from the command line, or from a default path
2) Produce
On Fri, May 27, 2011 at 1:00 PM, Sayth Renshaw wrote:
> On Fri, May 27, 2011 at 9:12 PM, Leo Lapworth wrote:
> > Hi,
> >
> > On 27 May 2011 10:26, Shlomi Fish wrote:
> >> On Friday 27 May 2011 09:35:32 Sayth Renshaw wrote:
> >>> Which Perl Should I use ActivePerl or Strawberry Perl on Windows?
> c:\>perl -wE "say $^V,$^O;$_='123456789';s§3(456)7§$1§;say"
> v5.12.1MSWin32
> 1245689
My equivalent that works is:
perl -wE "use utf8;my \$_='123456789';s§3(456)7§§\$1§;say;"
1245689
If I stop treating this section-sign delimiter as a bracketing delimiter, it
fails:
perl -wE "use utf8;m
> Hm, what platform and perl version?
5.8.8 and 5.12.2 on RHEL, and 5.10.0 on OS X 10.6.
> c:\>perl -Mutf8 -wE
>"say $^V,$^O;$_='123456789';s§3(456)7§$1§;say"
> Malformed UTF-8 character (unexpected continuation byte 0xa7,
> with no preceding start byte) at -e line 1.
Not the same err
>> I don't understand where a window could appear.
>
> On whatever workstation you designate through the DISPLAY environment
> variable.
Aha. Thanks.
> if you can come up with a test for whatever
> bug you are experiencing, it will be invaluable for saving time later.
Given the ease with whic
Thanks much for your various suggestions.
> recommend removing the ampersand from the function call: it is bad practice
> in anything but very old Perl.
Thanks. That deprecation hasn't made it into "man perlsub" yet, except for when
one is using prototyping.
> I would also prefer to lose a few
> Well, I have no idea why it does what it does, but I can tell you how to make
> it work:
> s¶3(456)7¶¶$1¶x;
> s§3(456)7§§$1§x;
Amazing. Thanks very much.
This seems to contradict the documentation. The perlop man page clearly says
that there are exactly 4 bracketing delimiters: "()", "[]", "{
> Are you familiar with the perl debugger?
Thanks much for your reply. I haven't used the debugger, partly because its
documentation describes it as an interactive tool and it's not clear to me how
that works in my context. The script is executed by httpd in response to a
browser form submissio
The perlop document under "s/PATTERN/REPLACEMENT/msixpogce" says "Any
non-whitespace delimiter may replace the slashes."
I take this to mean that any non-whitespace character may be used instead of a
slash.
However, I am finding that some non-whitespace characters cause errors. For
example, us
I'm seeking a strategy for diagnosing a bug that seems difficult to reduce to a
simple reproducible case.
The bug is that a hash element apparently becomes undef. When used as an
argument to "split" or "index", it generates a "Use of uninitialized value"
error.
The mysterious thing about this
hared libraries into the current process. Dynamically loading a shared
library adds the code to the current process; it does not invoke a separate
program/process.
--
Jonathan Leffler #include
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ours
The dynamic loader read LD_LIBRARY_PATH when (before?) Perl gets going. AFAIK,
it doesn't reread it, so changing it in Perl code is too late unless you set
it and exec your code again (which is basically saying it is too late).
I'm tolerably certain this applies to Solaris; I think it applies
There is a line in script we have that I find baffling, it is
print $cgi->header;
To me this seems to be printing the results of the header method of the CGI
module to standard output.
Is something else going on here as well?
Thanks
Thanks for all the input.
The head / tail solution would work, but isn't very scalable. I did
something similar on another file of comparable size and it took a long time
to complete.
The line numbers are 4million to 4million + some odd hundred thousand, just
to give an idea of the size.
The se
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
thanks
Or I could just remove the $ from the call.
$var1 = FOO::BAR::sub1();
works fine. I was referencing it like $FOO::BAR::sub1();
Thanks for the input however
On Tue, Apr 8, 2008 at 1:12 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-04-08 at 12:24 -0400, Jonathan M
I know this seems to be a very basic question, but I cannot figure out how
to access a modules subroutines.
We a module named FOO::BAR in which we access some hashes using this form:
$FOO::BAR::hash1
and it works fine.
When I try to access a subroutine in that same module, using this form:
$var1
How do I get the contents of a url? I mean passing a url to whatever object
and receiving the content of that webpage as a scalar.
I have a web service I want to test with perl, but I can't seem to find the
right command or module to this despite looking quite a bit.
thanks
event memory leaks as per
the above scenario or what?
thanks again.
On Mon, Mar 10, 2008 at 11:19 AM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> Jonathan Mast wrote:
> >
> > We have a socket server that, in addition to serving data, also writes
> > logging statements to a fi
We have a socket server that, in addition to serving data, also writes
logging statements to a file.
My question concerns the correctness of how it accesses the log file. The
script is running continuously and all the log file IO stuff is inside the
main 'while' loop.
The file is opened, written
I seem to have a vague memory about Perl not allowing comments before
program statements, but I'm not sure. I really want to add a lot of
comments at the top of a rather large module, but I'm unsure if thats safe.
thanks
Can you use the $main:: convention from inside a module to call a script
subroutine?
I know it can be used to reference fields from a script, but we seem to be
having problems when trying to call a subroutine.
thanks
I have a perl module that extensively uses a variable named "$main", which
is apparently bound to the script that calls the library.
I can't find where the exact semantics of this automagic variable defined.
thanks,
jhmast
-- Forwarded message --
From: Jonathan Mast <[EMAIL PROTECTED]>
Date: Jan 18, 2008 10:50 AM
Subject: Re: help me die verbosely
To: "Chas. Owens" <[EMAIL PROTECTED]>
OK, so were binding an anonymous subroutine to the DIE signal?
Does this need to go abov
I want to write the errors caught by a 'die' clause into a file.
In others words,
open F ">>somefile.log";
blah->blah or die (print F $@)
but the above does work.
thanks
, $a[1], $a[2], $a[3], $a[4], $b) = /(\d+), (\d+), (\d+),
(\d+), (\d+), Powerball: (\d+)/;
push @common, @a; push @powerball, $b;
}
When you're done, @common is (22, 29, 35, 46, 52, 1, 31, 38, 40, 53,
6, 16, 18, 29, 37), and @powerball is (2, 42, 24).
--
Jonathan "Dataweaver"
single string:
$string = join '', ;
will dump its contents into an anonymous list, which will then
be joined together seamlessly.
--
Jonathan "Dataweaver" Lang
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
ernatively, you might consider writing
the script to dump the comment contents to stderr, which could be
useful if you ever want to grep the contents of the comments instead
of the code. If you do this be sure to send a newline to stderr
whenever you end a line in code or quote context.)
--
Rob Dixon wrote:
> Jonathan Lang wrote:
> > I'm trying to devise a regex that matches from the first double-quote
> > character found to the next double-quote character that isn't part of
> > a pair; but for some reason, I'm
I'm trying to devise a regex that matches from the first double-quote
character found to the next double-quote character that isn't part of
a pair; but for some reason, I'm having no luck. Here's what I tried:
/"(.*?)"(?!")/
Sample text:
author: "Jon
appear there, and enclose the entire field in
quotes. So the field:
Jonathan "Dataweaver" Lang, programmer
would become:
"Jonathan ""Dataweaver"" Lang, programmer"
> Taking a sample report
>
> Hostname IP address Physic
If I merely split lines on /\|/, I get:
record 1: (3 fields)
"Harry
Sally"
Sleepless
record 2: (2 fields)
Jack
"Jill
record 3: (1 field)
""Walker"""
I need this so that I can use csv files generated by spreadsheet
applications such
library.n0i.net/programming/perl/articles/fm_prototypes/
"Broken" and "don't use them" is a bit extreme. But I will agree with
the general sentiment that they should not be used as a matter of
course; they should be reserved for a handful of special cases where
they help more
ROY(){
my $self;
$self->disconnect();
}
You never set $self to anything. Change the '()' in 'sub DESTROY()'
to '($)', or remove them altogether; then change 'my $self;' to 'my
$self = shift;' or 'my ($self) = @_;'
--
Jonathan "Dataweaver" Lang
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
#x27;()'; so shifting or assigning
from @_ to a list will always result in null assignments. Try
removing the '()' from the sub declaration lines.
--
Jonathan "Dataweaver" Lang
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Have you installed the Developer Tools from Apple Developer Connection?
http://connect.apple.com/
You have to download and install that toolset to get the compiler and
libraries. They do not come installed natively on the make.
Jon
On Apr 30, 2007, at 1:37 PM, Tom Allison wrote:
On Apr 29,
that were all the same, plus I figured this was a good
excuse to learn regexes.
Thanks for the help!
Jonathan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Hi. I have some HTML files with lines like the following:
A Title
I'm using a regular expression to find these and capture the name
attribute ("w12234" in the example) and the contents of the h2 tag ("A
Title").
$_ =~ /\s*<\/a>\s*(+)<\/h2>/
That's my regex, except I'm having trouble with
I am trying to lock out a batch of users. They are all in file "cleanup.txt".
All the users exist in "/etc/shadow". I have made a backup of "/etc/shadow" to
play with.
I cannot figure out why I cannot match users from the file with usernames in
field 0
of "/etc/shadow.bak". I am writing to "new
On Apr 12, 2005 4:24 PM, David Gilden <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to create case statement, and I am not sure I am on the right
> track,
> any comments?
perldoc Switch
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9
{deep}{hash} is a hash reference)
This will speed things up, and perhaps make code more readable.
I'll leave you to read up on how Perl does OO... not pretty but an
interesting and powerful approach.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+1
> I want to capture the return value of a "C" program
> called inside a perl script. How to do this?
perldoc -f system
To find out that you need $? and/or ($? >> 8).
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-
Can't call method "startR" on an undefined value at (eval
> 10)[/usr/local/lib/perl5/5.8.5/perl5db.pl:620] line 2.
Read the documentation:
http://search.cpan.org/~gmpassos/Statistics-R-0.02/lib/Statistics/R.pm
Note the 0.02 version number - you may have a rough ride.
Jonathan P
robably be better
> > than any suid program.
>
> Yes, i had consider this option too, maybe this can be the better
> solution, but what do you say about a C wrapper?
Depends on your knowledge of C security issues.
A carefully written C wrapper is going to be more secure than a
caref
unt.
* Using the existing samba web administration interface is not
possible - even if automated.
I would consider changing the group of smb.conf to say "lp", then the
permissions to 664. That would probably be better than any suid
program.
Jonathan Paton
--
#!perl
$J=' '
27; for 1, 3, 0, 2;
The eval is required because you can only set $_ to a constant
value.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
guess that named pipes and anonymous pipes
are implemented using the same code. The difference is
how the connection is established.
UNIX vs INET is another story. On loopback, I guess INET would
easily achieve 100MB/sec, and I think UNIX domain sockets
would be faster still.
Jonathan Paton
--
#
INET sockets?
I believe so, but the difference might not be that great. Which
seams more appropriate?
May the man pages help you in your quest.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 0
an avoid
having to ask. Perhaps the example had a misprint.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,=
#x27;t rely on
nobody noticing.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,
--
> i'm trying to figure out how to split a file delimited
> by commas and newlines.
Sounds like a CSV file to me, and for those you look on
CPAN for a ready made solution.
http://search.cpan.org/search?query=CSV&mode=module
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq&
m easy (if you get Win32:API or similar to do it) to hard (writing drivers
or using the XS layer).
I am not qualified to write about Win32::API.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00
quot;, unpack('C4', $ip);
}
$resolved{$name} = $ip;
}
Notice I have introduced a more meaningful loop variable,
removed "" as the default and used a hash instead.
I suggest you have the code reviewed.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10
dd it on.
If you need more information, please include the module name
you are using.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+)
scoped, using my,
then you wouldn't have to undef them. With strict you will HAVE
to learn to use "my" and "our".
> }
> }
>
So, the main lesson of the day is USE STRICT. You will save
days of debugging, which must qualify as being kind (if not gentle ;-)
Jon
your real
problem is when you have week 53. I think you need to only accept
the same or next year for today, and make adjustments if week 53
crops up.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
temporary directory. Debugging this would be too much
like work, maybe someone else would be interested. Sorry.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\
he chroot jail.
chroot should never be an excuse for running untrusted or
poor quality software. It is simply another layer of security,
which usually restricts damage if the code is exploited.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 0
> Is there a way to build splice portion: [9,10,11,15,25,28,31,32,34]
> ...
Yes, put those in an array. Like:
my @array = (9,10,11,15,25,28,31,32,34);
my $spliced = @[EMAIL PROTECTED];
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+1
h google for others!
> Perl is an eccentric language to be sure, ...
Not as much as the programmers that use it ;-)
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-
ou have
worked on the problem first. Minimum boilerplate for all scripts
should be:
use strict;
use warnings;
Documentation available via perldoc.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4
.
Why are you doing this? Is most of your experience with C?
Jonathan Paton
On Thu, 16 Dec 2004 19:18:06 +0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> i have intensively searched the web for a solution on the following problem,
> but could not find any
mplete
pathname (including filename) plus "/passwd", if that directory exists for
reading.
Or more clearly:
if (-r "$_/password") {
$chambers{$filename} = "$fullname/passwd"
}
The documentation for File::Find is the key to your troubles.
Jonathan Paton
--
#!perl
$
d and try. If the toolkit returns
an error then you know you don't have one.
In the situation you want to use X if available, terminal
otherwise, wouldn't it be better just to use an option?
More detail, better answers!
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+
n the new process will reopen
STDIN with
input coming from the keyboard. Or something like that.
I think you need to search for unix systems programming (in C). Once you know
how it is done in C, work out how to do the same in Perl.
Jonathan Paton [Writing of things I have little experien
also diff against a previous
version.
You could split your long(ish) script down in to smaller parts.
If you are really stuck, and you ARE using whitespace effectively,
then send a copy to MY mailbox (***NOT THE LIST***).
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
(
{ ip => ...,
agent => ...,
type => ...
},
...
);
Then you could do:
my @robots = grep { $_->{type} eq "robot" } @array
There are MANY alternatives.
---
A word about the task:
What happens when multiple agents use the same IP address?
Jonathan P
Hi,
I can only guess at the source of the problem. I think it is because that web
site requires cookies. The solution is to have a cookie jar, like:
my $agent = LWP::UserAgent->new();
$agent->cookie_jar({});
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-
Dear Kevin,
There are thousands of examples of POD on CPAN. E.g.
http://search.cpan.org/src/DCONWAY/Parse-RecDescent-1.94/lib/Parse/RecDescent.pod
Jonathan Paton
On Thu, 09 Dec 2004 09:17:50 -0500, KEVIN ZEMBOWER <[EMAIL PROTECTED]> wrote:
> Can anyone suggest a small mod
od
as my Perl ;-)
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
27;m trying to wrap the ReadKey call in an infinite loop, but it breaks
> as soon as I add the loop. Take away the loop, or convert the ReadKey
> to blocking, and it works just fine. Here's the test code snippet I'm
> using:
Jason,
Have you tried placing the two Read
Dear John,
It is likely that you cannot store complex datastructures in cookies. (at least
how the CGI module is currently written). You could try encoding the data
to a string.
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
grammers, but not the
type people hire to reverse engineer. Obfuscated code is likely to be
poor quality code (lack of pride - bugs hidden away).
http://www.stunnix.com/prod/po/sample.shtml
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
be more useful to other projects.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} w
die "Invalid output from ifconfig! Received: $ppp0\n"
}
Reason: By using a postfix conditional, you are placing emphasis on the
error message not the condition that follows it. I wouldn't normally expect
a postfix conditional to also have important side effects. You may not
agre
you can just
sleep for a second or two and then retry.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,
t mode goes even further.
Also consider where you want to display your errors. Usually, if you die
in a CGI script then the server logs get the die message. The user gets
500 - Internal Server Error and little else.
Jonathan Paton
--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7
@array = split //, $string;
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Dear Graeme,
The problem is with your employers filtering software, as the copy of the
same message I received was unaltered. Perl beginners is not the place
to ask about this.
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<h
ight" (and "track"). This RFC is
essentially that design (not surprisingly, since Damian wrote it), so
it will be accepted, albeit with several tweaks. "
Link:
http://dev.perl.org/perl6/apocalypse/A04.html
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additio
rint scalar (('Jan', ...)[-1]);
Or even:
print + (('Jan', ...)[-1]);
As always there is plenty of alternatives.
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
1 - 100 of 523 matches
Mail list logo