Re: problems with scalar(@array)

2002-12-17 Thread Chris Ball
extra iteration of the for loop over a non-existant element with the index $array[$#array+1]. So don't do that. :-) - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a | Q. How do you tell an extrovert techie from an introvert techie? | A. He l

Re: crypt()

2002-12-08 Thread Chris Ball
rypt::PasswdMD5; $pass = unix_md5_crypt($input_pass,$salt); Also, your double-quotes in the useradd command look redundant. Try removing them, if it still doesn't work. They may been being processed as part of the username/password. Hope this helps, - Chris. -- $a="printf.net&qu

Re: use warnings; and #!/usr/bin/perl -w

2002-11-26 Thread Chris Ball
quot;uninitialized"; .. and you wouldn't see initialization warnings in that scope. Hope this helps. perldoc perllexwarn for some more.. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: a question about output

2002-11-24 Thread Chris Ball
Pinyan <[EMAIL PROTECTED]> said: > Unbuffer STDOUT: > $| = 1; > See 'perldoc perlvar' for information about the $| variable. This doesn't help with storing the output from ls to a file rather than STDOUT, which should be done with something like: ope

Re: Advice wanted on project

2002-11-23 Thread Chris Ball
ry. - Chris. [1]: < http://www.bestpractical.com/rt/ >. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a | "> Banks use perl? Let me take my $money out. | Only banks for rich people. Banks for people like you use COBOL." | -- ga

Re: Anyone know what Perl Jaguar is coming with?

2002-08-15 Thread Chris Ball
recent is your information? < http://archive.develooper.com/macosx%40perl.org/msg02650.html > - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What Modul for use with imap?

2002-07-29 Thread Chris Ball
can answer questions like these with CPAN's search functions. I prefer the interface at < http://search-beta.cpan.org/ >. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "Blessings to the chap who invented ice cream, ginger-pop and t

Re: search and replace problem

2002-07-11 Thread Chris Ball
ssion occasionally. Here's the problem, though: Changes to $_ inside an FD are _not_ reflected back to a file. You can read 'perldoc -q "How do I change one line in a file"' for the suggested ways of doing modifications like this. Hope this helps, - Chris. -- Ch

Re: Modules

2002-07-06 Thread Chris Ball
ompiled into perl itself, I believe. You can manipulate it in script with the use lib ""; pragma or changing the bang-line to include -Idir. Outside of your script, you can manipulate the PERLLIB or PERL5LIB environment variables. - Chris. -- $a="printf.net"; Chris Ball | chri

Re: what happens with $b = $b++?

2002-06-30 Thread Chris Ball
ur code with: '$b = 1; $b++;' or '$b = 1; $b = $b + 1', you'll get more expected behaviour. :) - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "Blessings to the chap who invented ice cream, ginger-pop and the rest!

Re: GD + graphs

2002-06-12 Thread Chris Ball
a can be plotted to many different type of graph - GD::Graph::{lines,bars} etc.) - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "Blessings to the chap who invented ice cream, ginger-pop and the rest! I'd rather invent things like that any

Re: "printf" behaving oddly

2002-06-10 Thread Chris Ball
e that; that's what your '1' is - a success code. Your problems can be easily solved, though. sprintf() returns the string that printf() would have printed. You can just replace the printf() call with one to sprintf(), and all should work fine. :) Hope this helps, - Chris.

Re: CPAN viruses

2002-06-05 Thread Chris Ball
pt that runs 'rm -rf /' and getting you to type 'perl -MCPAN -e 'install Helpful::Script'' - it's trivial to get a CPAN account, and new uploads aren't vetted. In theory, though, it's likely that such a module would be noticed very quickly indeed, and re

Re: How to use crypt ??

2002-05-23 Thread Chris Ball
nd save it, doesn't work for me for some David> reason. Japhy has a page explaining crypt(), which should clear everything up for you. It's on-line at: http://www.crusoe.net/~jeffp/docs/crypt - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$

Re: equivalent of /* */

2002-05-21 Thread Chris Ball
used like this: print 1..3; =cut print 4..6; =cut print 7..9; (prints '123789') Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a chris@lexis:~$ perl -le'@a=($^O eq 'darwin')?qw(100453 81289 9159):qw (23152 19246 2040);while(<>){chomp;push @b,$_ if grep {$.==$_}@a}push @b,$^X;print ucfirst join(" ",@b[2,0,3,1]).","'

Re: FIle upload

2002-05-20 Thread Chris Ball
s if you can't figure it out. Bear in mind that many problems may be related to your webserver's CGI setup, and not to Perl itself at all. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a chris@lexis:~$ perl -le'@a=($^O eq 'darwin')?qw(100453 81289 9159):qw (23152 19246 2040);while(<>){chomp;push @b,$_ if grep {$.==$_}@a}push @b,$^X;print ucfirst join(" ",@b[2,0,3,1]).","'

Re: the homework assignment problem

2002-05-18 Thread Chris Ball
variables names that we use when describing how programs work, to show that we're talking about something that could be any variable. You can read about them at: http://www.tuxedo.org/jargon/html/entry/metasyntactic-variable.html - Chris. -- $a="printf.net"; Chris Ball

Re: help!

2002-05-18 Thread Chris Ball
r new homework can be to convert that solution to your task. :-) The post I'm thinking of is at: http://archive.develooper.com/beginners%40perl.org/msg16089.html - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a -- To unsubscribe, e

Re: Perldoc

2002-05-16 Thread Chris Ball
n my system yesterday. Cheers for all Harry> the replies. I've submitted a documentation patch on this and it's been applied to the 5.8 tree. There'll be mention of perltoc as a good place to start on the `perldoc perldoc` page in that release. Hope this helps, - Chris. -- $a=&qu

Re: Perldoc

2002-05-16 Thread Chris Ball
e POD. If this is the case, the perldoc page containing the table of contents for perldoc is found with: perldoc perltoc - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: urandom

2002-05-16 Thread Chris Ball
normal rand stuff Postman> from perl? Postman> Any ideas how I could code this, or is there a better way Postman> of actually getting random stuff. Someone beat you to it. :) The Crypt::Random CPAN module is an interface to /dev/random (and /dev/urandom). - Chris. -- $a=

Re: SFTP

2002-05-15 Thread Chris Ball
; into the search box at http://search.cpan.org. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: TIMTOWTDI

2002-05-12 Thread Chris Ball
>>>>> "jn" == josenyimi <[EMAIL PROTECTED]> writes: jn> The task is simply to upercase the first char of a given string jn> and lowercase the rest. $string = ucfirst lc $string; Nice try, though. :-) - Chris. -- $a="printf.net"; Chris B

Re: Pattern Matching...

2002-05-09 Thread Chris Ball
-- )end of grouping ------ void:chris~ Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "Never go in against a Sicilian when _death_ is on the line!" - Vizzini -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Script Versioning

2002-05-04 Thread Chris Ball
hing useful, and is stable and working as it should in what it does. Just some ideas, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "Never go in against a Sicilian when _death_ is on the line!" - Vizzini -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Parameters

2002-05-03 Thread Chris Ball
ortcut to having to bother issuing an open() call and have the unbearable hassle of setting up a file handle. We should have a Lazy Perl Programming FAQ, as a list of things that you can^Wshouldn't do to speed up a perl script. ;-) - Chris. -- $a="printf.net"; Chris Ball | chri

Re: Problem accessing the command line arguments

2002-05-02 Thread Chris Ball
arguments. The errors are with your code, rather than the population of @ARGV, in my opinion. There are certain situations where both could be the case, though, as someone else described for Windows. Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Parameters

2002-05-02 Thread Chris Ball
rrays are zero-indexed $argument2 = $ARGV[1]; # make sure that $argument{1,2} don't contain special chars $argument1 =~ s/[^A-Za-z0-9:\.]//; $argument2 =~ s/[^A-Za-z0-9:\.]//; do_something_with($argument1, $argument2); Hope this helps, - Chris. -- $a="printf.net";

Re: I want to make sure I get this right

2002-05-02 Thread Chris Ball
;s quip that "Nothing but perl can parse Perl." You may or may not choose to follow this usage. For example, parallelism means "awk and perl" and "Python and Perl" look OK, while "awk and Perl" and "Python and perl" do not. But

Re: Is anyone using the Google API?

2002-04-20 Thread Chris Ball
>>>>> "Me" == Chris Ball <[EMAIL PROTECTED]> writes: Me> I was wondering whether it would be worthwhile creating a CPAN Me> module - something like WWW::Google::SOAP - to allow simple Me> searches with the SOAP API, returning a nice hash. Look

Re: Is anyone using the Google API?

2002-04-20 Thread Chris Ball
ave more luck posting to 'google.public.web-apis' through http://groups.google.com. Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Cygwining off Re: perlcc - newbie - cannot compile successfully - sample sessio n

2002-04-20 Thread Chris Ball
directories would contain the modules under that namespace; for example, in Text/: lexis:chris...perl5/5.7.2/Text % ls Abbrev.pm Balanced.podSoundex.pm Wrap.pm Balanced.pm ParseWords.pm Tabs.pm Hope this helps. - Chris. -- $a="printf.net"; Chris Ball | chris@vo

Re: Funny character on a dir name.

2002-04-18 Thread Chris Ball
; signifies the end of switches, so it knows whatever follows is a path to a file. But this really is very off-topic. :-) - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find

Re: about formal sub routine declartions

2002-04-18 Thread Chris Ball
Simple with regexps to transform sub definitions. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Executing Shell Commands

2002-04-15 Thread Chris Ball
helps. perldoc -f system for more. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Convert Number In Strings to Numeric Form

2002-04-15 Thread Chris Ball
on). Hope this helps. perldoc -f sort for more information. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Sort a hash table

2002-04-02 Thread Chris Ball
are stored in a way that prevents you from imposing an order on key-value pairs. Instead, you have to sort a list of the keys or values: @keys = sort keys %hash;# sorted by key -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As

Re: command line arguments

2002-03-06 Thread Chris Ball
n with the shell. Nikola> I know I can put it in quotes but is there any other way Nikola> around it? Not as far as I know. 'script.pl file1\* \*file2\*' will pass them untouched, if you have access to what's happening at the shell level. - Chris. -- $a="printf.

Re: unusual character splitting

2002-03-06 Thread Chris Ball
27;use locale;' to the top of your script. It depends on your system's locale configuration being sane, but it should solve your problem if this is so. Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beg

Re: Still can't extract data using HTML::TokeParser

2002-02-25 Thread Chris Ball
ser to $stream) should fix things. I'd also switch to LWP::Simple, but that's up to you. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "1 is equal to 2 for sufficiently large values of 1." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl calling Visual Basic

2002-02-22 Thread Chris Ball
m('program'); ... but that assumes that the 'program' is something that can be entirely executed from the command line and returns a useful return code - I don't have familiarity with VB, but my short experiences seem to suggest that this would be rare. *awaits correction f

Re: file size

2002-02-22 Thread Chris Ball
ilename))[7]; ... to retrieve the size of $filename in bytes. More information at perldoc -f stat, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which exploded." -- To unsubscribe, e-mail

Re: What would take care of this?...

2002-02-22 Thread Chris Ball
egex would break, and the TokeParser code wasn't much longer. It's effectively impossible to parse HTML accurately with regexps. - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which explode

Re: What would take care of this?...

2002-02-22 Thread Chris Ball
t all data from H1 BGCOLOR="FF">I want all if this data extracted from Daniel> heading 1 (h1) while ($stream->get_tag("h1")) { $data = get_trimmed_text("/h1"); } (Also see perldoc HTML::TokeParser, once it's installed.) - Chris. -- $a="pr

Re: Web Address for Archives

2002-02-18 Thread Chris Ball
this might need to be re-encoded: http://archive.develooper.com/beginners%40perl.org/ Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which exploded." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Chris Ball
re the start position (0 - the first digit) and the range (three digits), and note the == to make a comparison rather than an assignment. Hope this helps, - Chris. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was

Re: A few Great Modules

2002-01-20 Thread Chris Ball
he links between them. I'm also still an HTML::TokeParser geek. TokeParser allows you to grab the contents of HTML tags, even if there's a complex structure to the page defining which tags you want to take and which you don't. Hope either of these spark someone's interest.

Re: USE IMPORT REQUIRE

2002-01-06 Thread Chris Ball
oking at Python source somewhere. It does have a use in perl, but as a special subroutine name; described in perldoc -f import. 'import Some::Module' is not valid perl code. Hope this helps, - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$

Re: database to mail

2001-12-24 Thread Chris Ball
ig } @array; # Remove <(p|P)> for each array element. Hope this helps. Merry Christmas, list! - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-m

RE: summarizing a list of numbers?

2001-12-17 Thread Chris Ball
problem, even if they don't; fun to solve, even if my method was (*cough*) a little long. Thanks, - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which exploded." -- To unsubscribe,

RE: summarizing a list of numbers?

2001-12-17 Thread Chris Ball
On Mon, 2001-12-17 at 15:46, Jeff 'japhy' Pinyan wrote: > It certainly puts my C-like code to shame. It's very nice. And even more so to my code. Very well written, Bob. - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a

Re: summarizing a list of numbers?

2001-12-17 Thread Chris Ball
nk of using regexps. And you called _me_ a regexp master yesterday. Sigh. I wrote: > > I'll bow down to anyone who can make a one-liner of it, naturally. > It reduced a sizeable algorithm down to one simple regex: > s/\b(\d+)(?:,((??{1+$+})\n))+/$1-$+/g; - ~C. -- $a=&qu

Re: summarizing a list of numbers?

2001-12-17 Thread Chris Ball
can make a one-liner of it, naturally. Hope this helps - out of interest, what sort of UNIX command _needs_ a list like that instead of an explicit one? - ~C. void:chris~ % cat compact.pl #!/usr/bin/perl -w # Author: Chris Ball <[EMAIL PROTECTED]> # Function: Provide a 'compact

Re: Win32::Console.

2001-12-13 Thread Chris Ball
#x27;t a typo at all. Oops. - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners' proverb: Gold is where you find it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Win32::Console.

2001-12-13 Thread Chris Ball
D, which has documentation and sample usage for each function. The [EMAIL PROTECTED] mailing list would be a good place to follow-up to if you still have questions. - ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a As to luck, there's the old miners

Re: Opening a URL

2001-12-07 Thread chris . ball
On Fri, 2001-12-07 at 17:19, Juan Manuel Espinoza wrote: > How can i open a URL in PERL? With the 'LWP' modules. In this case, putting the HTML to Google's front page in $content: use LWP::Simple; my $content = get( "http://www.google.com/"; ) or die $!; Hope

Re: thanks for the info on removing control m's

2001-12-06 Thread Chris Ball
ubstr: void:chris~ % echo "abcdefgh" | perl -nle 'print substr($_, -3, 3)' [ -3 makes us start here ^, 3 makes us travel for three characters. ] > Left can be done with substring (x,0) I am sure Yes, indeed: echo "abcdefgh" | perl -nle 'print substr($_, 0,

Re: 'vacation'

2001-11-27 Thread Chris Ball
and everyone running a local server can reject based on this hash. It's probably overkill for me, but it sounds like you get enough spam to use it - assuming you have control of the machine your mail comes to. (which I'll assume, based on your mail address of webmaster@) Just an idea,

Re: Parsing HTML for SPSS

2001-11-27 Thread Chris Ball
d, and I'm in need of sleep. If anyone more alert than myself can see anything stupid, please let me know. :-) If you need a hand with initialising the object, I've got a tutorial to TokeParser (though also manipulating XML:RSS) up on the web at: http://www.perl.com/pub/a/2001/11/15/

Re: SALT in CRYPT!!

2001-11-22 Thread chris . ball
helps, - ~C. -- Chris Ball E-mail: [EMAIL PROTECTED] Web Programmer Web : www.fastsearch.com Fast Web Media Ltd Mobile: +44 (0)7769 903 770 12th Floor Sunlight House, Quay Street, Manchester M3 3JZ, UK. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Doh! Formmail

2001-11-15 Thread Chris Ball
ail I'd recommend these. Hope this helps, ~C. -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which exploded." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Trying to use the => notation to print the values from this hash

2001-11-13 Thread Chris Ball
gt; in the last line is not necessary: print "Value: ", $unix{"SHELL"}\n"; will DWYM. As a side point, you might be interested to know that the environmental variables that your hash represents are already available from within perl, in the %ENV hash. For example, '

Re: recommended perl training in UK?

2001-11-13 Thread Chris Ball
com/ being the most obvious example. [2]: Simon Cozens' NetThink comes to mind - http://www.netthink.co.uk/ -- $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a "In the beginning there was nothing, which exploded." -- To unsubscri

Re: extracting between tags

2001-11-12 Thread Chris Ball
;get_trimmed_text("br"); You'll have some small tidying up to do on both, but it's a /much/ more readable (and maintainable) way of parsing the HTML. Hope this helps, (from one Manchester perl bod to another ;-) ~C. -- $a="printf.net"; Chris Ball | chris@void.$a |

Re: Off-Topic (200%) - Where are you from?

2001-11-10 Thread Chris Ball
to be my sole programming language. :-) ~C. -- Chris Ball. [EMAIL PROTECTED] || http://printf.net/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]