Re: Storing Output file.

2016-02-02 Thread Jonathan Harris via beginners
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 >

Re: Storing Output file.

2016-01-29 Thread Jonathan Harris via beginners
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

Re: Storing Output file.

2016-01-29 Thread Jonathan Harris via beginners
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 &

Re: Storing Output file.

2016-01-28 Thread Jonathan Harris via beginners
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 );

Re: Which Is Good?

2015-03-12 Thread Jonathan Harris
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 >

Re: Win32 - Killing Processes - update possible solution

2013-04-10 Thread Jonathan Harris
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

Re: Win32 - Killing Processes

2013-04-10 Thread Jonathan Harris
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

Re: Win32 - Killing Processes - update possible solution

2013-04-09 Thread Jonathan Harris
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

Re: Win32 - Killing Processes - update possible solution

2013-04-09 Thread Jonathan Harris
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

re: Win32 - Killing Processes

2013-04-08 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2012-01-02 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2011-12-30 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2011-12-30 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
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

Re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
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

re: File Size Script Help - Working Version

2011-12-29 Thread Jonathan Harris
;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

Re: File Size Script Help

2011-12-19 Thread Jonathan Harris
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

Re: File Size Script Help

2011-12-19 Thread Jonathan Harris
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 >

re: File Size Script Help

2011-12-19 Thread Jonathan Harris
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

Re: practical perl guides

2011-05-27 Thread Jonathan Harris
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?

Re: Regexp delimiters

2010-12-08 Thread Jonathan Pool
> 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

Re: Regexp delimiters

2010-12-08 Thread Jonathan Pool
> 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

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Jonathan Pool
>> 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

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Jonathan Pool
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

Re: Regexp delimiters

2010-12-07 Thread Jonathan Pool
> 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: "()", "[]", "{

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Jonathan Pool
> 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

Regexp delimiters

2010-12-05 Thread Jonathan Pool
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

Strategy for diagnosing context-sensitive bug

2010-12-03 Thread Jonathan Pool
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

Re: How to set LD_LIBRARY_PATH

2010-06-01 Thread Jonathan Leffler
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

Re: How to set LD_LIBRARY_PATH

2010-05-29 Thread jonathan . leffler
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

What does "print $cgi->header" do?

2008-04-21 Thread Jonathan Mast
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

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
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

Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
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

Re: How do I access module subroutines?

2008-04-09 Thread Jonathan Mast
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

How do I access module subroutines?

2008-04-08 Thread Jonathan Mast
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?

2008-03-12 Thread Jonathan Mast
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

Re: Filehandles in a socket server

2008-03-10 Thread Jonathan Mast
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

Filehandles in a socket server

2008-03-10 Thread Jonathan Mast
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

Are comments allowed before package declarations in modules?

2008-02-26 Thread Jonathan Mast
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

Fwd: more fun with $main::

2008-02-08 Thread Jonathan Mast
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

Where is $main defined?

2008-01-22 Thread Jonathan Mast
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

Fwd: help me die verbosely

2008-01-18 Thread Jonathan Mast
-- 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

help me die verbosely

2008-01-17 Thread Jonathan Mast
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

Re: Regex Help

2007-11-10 Thread Jonathan Lang
, $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"

Re: How to reinvent grep in perl?

2007-10-04 Thread Jonathan Lang
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/

Re: How to reinvent grep in perl?

2007-10-03 Thread Jonathan Lang
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.) --

Re: regex help

2007-09-25 Thread Jonathan Lang
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

regex help

2007-09-25 Thread Jonathan Lang
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

Re: CSV file

2007-09-21 Thread Jonathan Lang
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

Re: parsing csv-file for inserting in database

2007-09-17 Thread Jonathan Lang
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

Re: Error:Can't locate object method "prepare" via package "abc" at xyz.pm

2007-05-31 Thread Jonathan Lang
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

Re: Error:Can't locate object method "prepare" via package "abc" at xyz.pm

2007-05-31 Thread Jonathan Lang
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/

Re: Passing arguments to subroutine

2007-05-31 Thread Jonathan Lang
#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/

Re: MAC and install CPAN

2007-04-30 Thread Jonathan Heard
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,

Re: regular expression help

2006-07-24 Thread Jonathan Weber
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>

regular expression help

2006-07-24 Thread Jonathan Weber
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

cannot match string

2005-05-11 Thread Jonathan Soons
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

Re: Case statements

2005-04-12 Thread Jonathan Paton
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

Re: pointers - references ??

2005-04-11 Thread Jonathan Paton
{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

Re: Capturing the integer return value of a "C" program, called inside perl script

2005-04-10 Thread Jonathan Paton
> 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-

Re: Statistics::R

2005-03-27 Thread Jonathan Paton
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

Re: suidperl.

2005-03-27 Thread Jonathan Paton
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

Re: suidperl.

2005-03-27 Thread Jonathan Paton
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=' '

Re: Simplify perl -e '$a = [1,2,3,4,7]; print $a->[$#{@$a}]'

2005-03-12 Thread Jonathan Paton
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/(

Re: IO::Socket::UNIX questions

2004-12-31 Thread Jonathan Paton
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 -- #

Re: IO::Socket::UNIX questions

2004-12-30 Thread 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

Re: How to create and use external modules with ActiveState Perl 5.8+?

2004-12-29 Thread Jonathan Paton
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,=

Re: Variable Value into MySQL DB

2004-12-27 Thread Jonathan Paton
#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,, --

Re: pattern matching question

2004-12-23 Thread Jonathan Paton
> 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&

Re: Accessing DLL functions

2004-12-23 Thread Jonathan Paton
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

Re: Uninitialized value in unpack

2004-12-23 Thread Jonathan Paton
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

Re: Converting a array to a scalar

2004-12-23 Thread Jonathan Paton
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+) (.+)

Re: Word Automation through Win32::OLE

2004-12-22 Thread Jonathan Paton
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

Re: Calculating week numbers across years

2004-12-21 Thread Jonathan Paton
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

Re: trying to chroot perl and its modules

2004-12-18 Thread Jonathan Paton
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\

Re: trying to chroot perl and its modules

2004-12-18 Thread Jonathan Paton
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

Re: Dynamic Splice

2004-12-17 Thread Jonathan Paton
> 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

Re: variable declaration, was RE: moving to the next line

2004-12-17 Thread Jonathan Paton
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-

Re: combining getc() and unicode strings problem?

2004-12-16 Thread Jonathan Paton
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

Re: combining getc() and unicode strings problem?

2004-12-16 Thread Jonathan Paton
. 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

Re: find sub {}

2004-12-16 Thread Jonathan Paton
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 $

Re: How to detect present X-Server

2004-12-16 Thread Jonathan Paton
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+

Re: receiving input from different sources

2004-12-15 Thread Jonathan Paton
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

Re: Finding missing syntax element

2004-12-12 Thread Jonathan Paton
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

Re: traversing (and accessing values in) a hash of hashes

2004-12-11 Thread Jonathan Paton
( { 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

Re: LWP::UserAgent -> Not in this case?

2004-12-09 Thread Jonathan Paton
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-

Re: Good examples of POD for newbies?

2004-12-09 Thread Jonathan Paton
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

Re: Need advanced help with tracking down warnings in eval'd functions

2004-12-09 Thread Jonathan Paton
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>

Re: Term::ReadKey substitute for perl v5.8.0

2004-12-08 Thread Jonathan Paton
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

Re: Help with cookies

2004-12-08 Thread Jonathan Paton
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

Re: I am looking for a free perl compiler.

2004-12-08 Thread Jonathan Paton
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

Re: Need help with Curses

2004-12-07 Thread Jonathan Paton
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

Re: Help optimizing script

2004-12-07 Thread Jonathan Paton
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

Re: Monitor Squid access.log

2004-12-07 Thread Jonathan Paton
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,

Re: File generation not working

2004-12-07 Thread Jonathan Paton
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

Re: String to Character Array

2004-12-06 Thread Jonathan Paton
@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>

Re: [Released] [Contains offensive content] RE: Building Network Redundancy into a Perl Client

2004-12-06 Thread Jonathan Paton
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

Re: built-in switch statement?

2004-12-06 Thread Jonathan Paton
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

Re: a warning which i can't understand

2004-12-05 Thread Jonathan Paton
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   2   3   4   5   6   >