[23380] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5599 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 1 18:05:46 2003

Date: Wed, 1 Oct 2003 15:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 1 Oct 2003     Volume: 10 Number: 5599

Today's topics:
    Re: [Simple] Function arguments and return value <jgibson@mail.arc.nasa.gov>
        dashes or tildies? <me@privacy.net>
    Re: dashes or tildies? <uri@stemsystems.com>
    Re: dashes or tildies? <dorward@yahoo.com>
    Re: dashes or tildies? <me@privacy.net>
    Re: dashes or tildies? <tore@aursand.no>
    Re: Debug Messages <emschwar@pobox.com>
    Re: English dictionary world list (Quantum Mechanic)
    Re: English dictionary world list (laura fairhead)
    Re: GD::Graph: "mixed" graph doesn't recognize "area" g (Emilio Mayorga)
    Re: hashes (John Carroll)
    Re: How to generate this list? <krahnj@acm.org>
    Re: How to generate this list? <abigail@abigail.nl>
    Re: How to generate this list? <mikeflan@earthlink.net>
    Re: How to generate this list? <minceme@start.no>
        How to use proxy in Net::HTTP, not in LWP::UserAgent? (Great Deals)
    Re: Make problems (trwww)
    Re: Newbie Q - Nicer way to lc something? <uri@stemsystems.com>
    Re: Newbie Q - Nicer way to lc something? <tore@aursand.no>
    Re: Newbie Q - Nicer way to lc something? <grazz@pobox.com>
    Re: Newbie Q - Nicer way to lc something? <mpapec@yahoo.com>
    Re: Oops, 5.8.1 broke my program <abigail@abigail.nl>
    Re: Perl Book Recommendations <krahnj@acm.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 01 Oct 2003 14:13:41 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: [Simple] Function arguments and return value
Message-Id: <011020031413410211%jgibson@mail.arc.nasa.gov>

In article <c5a22ad.0309221554.6f1b32e8@posting.google.com>, Gao Chao
<gaochao@voila.fr> wrote:

> I don't know how to write a function with arguments and return values
> that are not scalars. I have learn to write something like
> 
> sub foo {
>   my $arg1 = shift;
>   my $arg2 = shift;
> 
>   return $bar;
> }
> 
> but I cannot pass lists or file handles like that. Can somebody
> explain me how to pass lists and file handles as arguments and return
> values of a function?
> 
> Thanks!
> 
> GC

Use references to pass more than one array to a subroutine:

   perldoc -q 'How can I pass/return'

You may return an array from a subroutine.


------------------------------

Date: Wed, 1 Oct 2003 13:26:30 -0500
From: "Charles Howse" <me@privacy.net>
Subject: dashes or tildies?
Message-Id: <vnm72sho6itpc9@corp.supernews.com>

Hi,
I've *copied* the following from "FreeBSD Unleashed" p. 699, but my old eyes
won't allow me to see the book text clear enough to tell whether the
characters I've marked with ^ are dashes or tildies.  Would someone be kind
enough to tell me what they should be?  I've put in tildies, but I'm not
sure.

#!/usr/bin/perl
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
             ^
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
             ^
$value =~ s/~!/ ~!/g;
             ^    ^    ^
$FORM{$name} = $value;
}
open (MAIL,"| /usr/sbin/sendmail -oi -t");
print MAIL "From: $FORM{'name'} <$FORM{'email'}>\n";
print MAIL "To: charles\n";
print MAIL "Subject: Contact form output\n\n";
print MAIL "$FORM{'name'}, from $ENV{'REMOTE_HOST'} ($ENV{'REMOTE_ADDR'}),
has sent you the following comment:\n\n";
print MAIL "$FORM{'comment'}\n";
close (MAIL);
print "Location: http://howse.no-ip.org/thanks.shtml\n\n";


TIA,
Charles




------------------------------

Date: Wed, 01 Oct 2003 18:29:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: dashes or tildies?
Message-Id: <x7d6dgu7zp.fsf@mail.sysarch.com>

>>>>> "CH" == Charles Howse <me@privacy.net> writes:

  CH> #!/usr/bin/perl
  CH> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  CH> @pairs = split(/&/, $buffer);
  CH> foreach $pair (@pairs)
  CH> {
  CH> ($name, $value) = split(/=/, $pair);
  CH> $value =~ tr/+/ /;
  CH>              ^
  CH> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  CH>              ^
  CH> $value =~ s/~!/ ~!/g;
  CH>              ^    ^    ^
  CH> $FORM{$name} = $value;
  CH> }

if you use CGI.pm like you should, then it doesn't matter what the char
is. if you don't realize it, the above code is buggy and crappy and
cargo cult. 

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Class in Boston - Sept 2003 -- http://www.stemsystems.com/class


------------------------------

Date: Wed, 01 Oct 2003 19:40:19 +0100
From: David Dorward <dorward@yahoo.com>
Subject: Re: dashes or tildies?
Message-Id: <blf72i$mau$2$8302bc10@news.demon.co.uk>

Charles Howse wrote:

> my old eyes won't allow me to see the book text clear enough to tell
> whether the characters I've marked with ^ are dashes or tildies.

http://makeashorterlink.com/?G1ED22116 >:) 

-- 
David Dorward                                       http://dorward.me.uk/


------------------------------

Date: Wed, 1 Oct 2003 14:03:09 -0500
From: "Charles Howse" <me@privacy.net>
Subject: Re: dashes or tildies?
Message-Id: <vnm97hohl91sf2@corp.supernews.com>


"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7d6dgu7zp.fsf@mail.sysarch.com...
> >>>>> "CH" == Charles Howse <me@privacy.net> writes:
>
>   CH> #!/usr/bin/perl
>   CH> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>   CH> @pairs = split(/&/, $buffer);
>   CH> foreach $pair (@pairs)
>   CH> {
>   CH> ($name, $value) = split(/=/, $pair);
>   CH> $value =~ tr/+/ /;
>   CH>              ^
>   CH> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>   CH>              ^
>   CH> $value =~ s/~!/ ~!/g;
>   CH>              ^    ^    ^
>   CH> $FORM{$name} = $value;
>   CH> }
>
> if you use CGI.pm like you should, then it doesn't matter what the char
> is. if you don't realize it, the above code is buggy and crappy and
> cargo cult.

I'm sorry, but I don't have any idea what you're talking about.
Isn't it obvious that I know nothing about perl?
I'm just tinkering with a script I found in a book.
I understand 'buggy' and 'crappy', what is 'cargo cult'?




------------------------------

Date: Wed, 01 Oct 2003 22:25:52 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: dashes or tildies?
Message-Id: <pan.2003.10.01.18.50.19.735896@aursand.no>

On Wed, 01 Oct 2003 13:26:30 -0500, Charles Howse wrote:
> I've *copied* the following from "FreeBSD Unleashed" [...]

Don't use that book to learn about Perl in the future.  The code you refer
to is - ehm - ugly.

> #!/usr/bin/perl
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs)
> {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
>              ^
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>              ^
> $value =~ s/~!/ ~!/g;
>              ^    ^    ^
> $FORM{$name} = $value;
> }

Don't try to read the 'CONTENT_LENGTH' yourself.  Let CGI.pm do the job;

  #!/usr/bin/perl
  #
  use strict;
  use warnings;
  use CGI qw(:cgi);

  my $cgi = CGI->new();

> open (MAIL,"| /usr/sbin/sendmail -oi -t");
> print MAIL "From: $FORM{'name'} <$FORM{'email'}>\n";
> print MAIL "To: charles\n";
> print MAIL "Subject: Contact form output\n\n";
> print MAIL "$FORM{'name'}, from $ENV{'REMOTE_HOST'} ($ENV{'REMOTE_ADDR'}),
> has sent you the following comment:\n\n";
> print MAIL "$FORM{'comment'}\n";
> close (MAIL);
> print "Location: http://howse.no-ip.org/thanks.shtml\n\n";

  if ( open(MAIL, '| /usr/sbin/sendmail -oi -t') ) {
      my $name    = $cgi->param( 'name'    ) || '';
      my $email   = $cgi->param( 'email'   ) || '';
      my $comment = $cgi->param( 'comment' ) || '';
      my $host    = $ENV{ 'REMOTE_HOST' }    || '';
      my $addr    = $ENV{ 'REMOTE_ADDR' }    || '';

      # Do the print MAIL stuff (I would have limited it to using _one_
      # print statement, though.

      close( MAIL );

      print $cgi->redirect( 'http://howse.no-ip.org/thanks.shtml' );
  }
  else {
      # Do the error handling here; Couldn't 'open' sendmail
  }

In addition, I would have used an existing module to actually send the
mail.  Never done that in a long time myself, but I remember Net::SMTP
being a nice one.

The code above is totally untested, but since this _is_ a Perl group...


-- 
Tore Aursand <tore@aursand.no>



------------------------------

Date: Wed, 01 Oct 2003 13:53:24 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Debug Messages
Message-Id: <etor81wbuq3.fsf@wormtongue.emschwar>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> Also like in C, it can't be (easily) activated from the command line.  If
> you want that, it is probably better to provide a key like --debug via
> Getopt::Long and query the option.

That isn't easy?  Wow, you must have a lot lower standard for "hard"
than I do. -_^;

use Getopt::Long;
my %opt = (); # initialization not necessary, just a habit
die 'Error parsing options' unless GetOptions(\%opt, "debug");

> I also find it worthwhile to write an almost-trivial subroutine like
>
>     sub debug {
>         print "@_\n" if $opt{ debug};
>     }
>
> so you can easily make changes to all debugging output (such as directing it
> to STDERR, or adding caller information).

I actually have a whole module to do stuff like that-- not just for
debugging info, but for progress messages, warnings, notes, and so
on.  It's very handy.

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


------------------------------

Date: 1 Oct 2003 12:16:50 -0700
From: quantum_mechanic_1964@yahoo.com (Quantum Mechanic)
Subject: Re: English dictionary world list
Message-Id: <f233f2f0.0310011116.234ffaa8@posting.google.com>

Chris Smith <chris@FLARBLEinfinitemonkeys.org.uk> wrote in message news:<bleocl$rc8$2$8300dec7@news.demon.co.uk>...
> Hi,
> 
> Anyone know where to get an English dictionary word list in flat text format
> without definitions?  

The wordgame groups will have links to them. For instance, search for
Scrabble. There are many to choose from, depending on your context.
Some will adhere to certain rules, such as "only lowercase words with
no punctuation (apostrophes, hyphens)".


------------------------------

Date: Wed, 01 Oct 2003 20:20:28 GMT
From: run_signature_script_for_my_email@INVALID.com (laura fairhead)
Subject: Re: English dictionary world list
Message-Id: <3f7b367c.54331076@NEWS.CIS.DFN.DE>

On Wed, 01 Oct 2003 15:26:52 +0100, Chris Smith <chris@FLARBLEinfinitemonkeys.org.uk> wrote:

>Hi,
>
>Anyone know where to get an English dictionary word list in flat text format
>without definitions?  
>
>I'm going to use the wordlist as test data for something rather large.
>
>Preferably British English but any English will do as it's only test data.


The ENABLE word list is American English (seems to include both
American and British spellings) but I think it's one of the
biggest word lists that is public domain;

http://personal.riverusers.com/~thegrendel/software.html


greetings from
l

>
>Thanks,
>
>-- 
>Chris Smith
>http://www.infinitemonkeys.org.uk/

-- 
echo alru_aafriehdab@ittnreen.tocm |sed 's/\(.\)\(.\)/\2\1/g'


------------------------------

Date: 1 Oct 2003 14:42:42 -0700
From: e.mayorga@co.snohomish.wa.us (Emilio Mayorga)
Subject: Re: GD::Graph: "mixed" graph doesn't recognize "area" graph type
Message-Id: <faa70e85.0310011342.581cdf4@posting.google.com>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnbnk7nn.d8h.mgjv@martien.heliotrope.home>...
> On 30 Sep 2003 11:55:49 -0700,
> 	Emilio Mayorga <e.mayorga@co.snohomish.wa.us> wrote:
> > Hi,
> > 
> > I'm using the GD::Graph module to create some graphs (great module,
> > BTW!). Everything works fine. But in a "mixed" graph, "area" graphs
> > are not recognized. I get this error message:
> > [snip] unknown type area, assuming lines at [snip]
> > I am trying to create a chart with two lines and three area graphs.
> > The lines work fine. Area graphs work fine when used by themselves
> > (not in a mixed graph); I wrote a small program to test this.
> 
> That's odd. Area charts should work. There's an example (sample61) in
> the distribution that uses lines, bars, points, area, and linespoints,
> all in one chart. Where is the code you tried?

Thanks, Martin. BTW, I have your book; it's a great resource. I got
GD::Graph from the ActiveState site, and it didn't come with samples.
I went ahead and got sample61 from CPAN. It ran just fine with my
current versions of GD and GD::Graph!!

The code is somewhat complex. It connects to an Access database using
Win32::OLE and the DAO (the precursor to ADO), and pulls data in. Then
it goes off to create several graphs and png files from them, and HTML
files. I use the GD::Graph::Data class and the add_point method to add
data to the graphs. It's all a little messy and not so well documented
right now. If you really want to see it, you can grab it here (I've
removed strings that hold full file paths, to cover my back with my
employer):
http://www.co.snohomish.wa.us/publicwk/swm/maps/floodwarn2.pl
You'll find a sample output graph here:
http://www.co.snohomish.wa.us/publicwk/swm/maps/hydrograph_sens585.png
The three colored dashed horizontal lines are the ones I'm trying to
turn into area graphs. Each one of them is specified as a simple set
of two points, the start and end of the line.

As for the graph overall, basically, it's a time series with one
vertical reference line, and three horizontal reference lines that I'd
like to turn into area graphs.

> > I am using ActiveState Perl 5.6.1 on Win2000; GD 1.27, GD::Graph 1.31.
> 
> You should upgrade GD::Graph. That's a rather old version. But I don't
> think that that is your problem. sample61 was already in the
> distribution back then.

Those are the versions that ActiveState had a year ago. Anyways, it
does like the version may not be the problem. Like I said, sample61
does work, and so does a test I ran using an area graph (not "mixed").
I also tried creating a legend, and that worked as it should: the area
graphs got area-type legends, even though  the graph themselves gave
me the error message and were created with the default type (lines).

> > The X-axis on my graph is numerical. I don't know if that makes a
> > difference.
> 
> It might, since bar charts and area charts are not normally used with
> numerical X axes. I probably never tried them. However, I don't think
> you should get that message anyway. I just tried sample61 with numerical
> axes, in my development tree, and didn't get that message, but I'm a
> few versions ahead of you.
> 
> You should probably just show the (minimal) code example that produces
> this problem.

I'm not sure where the problem is exactly, so I'm not sure what code
fragments to show you. I've tried removing some of the graph options,
but to no effect. Here are the lines that add the two points for each
of the three graphs that I want to plot as area graphs:
$data->add_point($tm{min}, undef, undef, 
                 $sensorgraph{$sensor_id}->{floodphase1}, 
                 $sensorgraph{$sensor_id}->{floodphase2}, 
                 $sensorgraph{$sensor_id}->{floodphase3});
$data->add_point($tm{max}, undef, undef, 
                 $sensorgraph{$sensor_id}->{floodphase1}, 
                 $sensorgraph{$sensor_id}->{floodphase2}, 
                 $sensorgraph{$sensor_id}->{floodphase3});

Points for the other two graphs (1st and 2nd graphs) are added in
separate statements. This is the code that sets all graph options:
  $chart = GD::Graph::mixed->new(630,450);  # 700,500

  # set graph layout properties
  $chart->set(
      r_margin      => 20,
      t_margin      => 10,
      b_margin      => 20,
      transparent   => 0,
      fgclr         => 'dgray',
      labelclr      => 'black',
      axislabelclr  => 'black',
      line_width    => 2,
      x_long_ticks  => 0,
      x_tick_number => 36,
      x_label_skip  => 3,
      x_min_value   => $tm{min},
      x_max_value   => $tm{max},
      x_number_format => \&x_format,
      y_label       => 'Stage (ft)',
      y_long_ticks  => 1,
      y_min_value   => $sensorgraph{$sensor_id}->{lowgraph},
      y_max_value   => $sensorgraph{$sensor_id}->{highgraph},
      types         => [qw(lines lines area area area)],
      line_types    => [1, 3, 2, 2, 2],
      dclrs         => [qw(blue gray green lyellow lred)]
  );

Note that I've tried it without the "line_types" option, but it made
no difference.

Thanks for your help!

-Emilio


------------------------------

Date: 1 Oct 2003 14:53:37 -0700
From: john.carroll@usap.gov (John Carroll)
Subject: Re: hashes
Message-Id: <6b4da9ff.0310011353.49d6cd5d@posting.google.com>

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message news:<QSpeb.23654$Wd7.21629@nwrddc03.gnilink.net>...
> John Carroll wrote:
> > How do you get the actual string value of a hash value, when the key
> > is known?
> 
> Do you want to the value or do you want the value as a string? Those may be
> two different requests.

I don't care what type it is, but I am comparing it to a string, so I
assume it has to be a string for the comparison to work properly.

> > %in is set using the &ReadParse from cgi-lib.pl, with "Password" being
> > one of the keys, with a value of "test".
> >
> > $file_password = "test";
> > $password = $in{"Password"};
> 
> You are doing it right there.
> $password now contains the value of the hash %in for the key 'Password'.
> 
> If you want to make sure that the value is a string (why do you care?) then
> just concatenate the value with an empty string.

I don't care, but my comparison to a string doesn't work.  I
concatenated it with an empty string and I still get the same answer
as originally, which was that if I compare two strings that print
identically, the comparison fails (returns not equal).  Also, if I set
both variables to strings explicitly, or even only explicitly reset
the variable that originally holds the value of the hash %in for the
key 'Password', I get the comparison to work properly, but if I leave
it as shown above, the comparison fails.

*snip*
 
> jue

thanks,
john


------------------------------

Date: Wed, 01 Oct 2003 19:02:09 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: How to generate this list?
Message-Id: <3F7B247C.586F33C@acm.org>

Bryan wrote:
> 
> If I have the following:
> 
> 4 A's, 2 B's, 1 C, 3 D's
> 
> What's the best way to create a list of -all- the possible combinations
> of these letters?

I don't know if this is the best way but:

my @array = qw/ A A A A B B C D D D /;

print "$_\n" for glob "{@{[ join ',', @array ]}}" x @array;


:-)

John
-- 
use Perl;
program
fulfillment


------------------------------

Date: 01 Oct 2003 19:54:16 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How to generate this list?
Message-Id: <slrnbnmc78.tun.abigail@alexandra.abigail.nl>

Vlad Tepes (minceme@start.no) wrote on MMMDCLXXXIII September MCMXCIII in
<URL:news:slrnbnm13o.64i.minceme@imap-a.start.no>:
//  * Bryan <bryan@akanta.com>              (CCLXXIV'th day of year MMIII)
//  
// > If I have the following:
// >
// > 4 A's, 2 B's, 1 C, 3 D's
// >
// > What's the best way to create a list of -all- the possible combinations 
// > of these letters?
//  
//  Maybe you could use this? (untested, this'll be a long list...)
//  
//      #!/usr/bin/perl
//      use strict;
//      use warnings;
//      use Algorithm::Permute;
//  
//      my $p = new Algorithm::Permute([ split //, "AAAABBCDDD" ]);
//      while (my @res = $p->next) {
//          print join("", @res), "\n";
//      }


That will do 3628800 iterations, but there are only 12600 different
permutations.



Abigail
-- 
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
           ${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'


------------------------------

Date: Wed, 01 Oct 2003 21:41:10 GMT
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: How to generate this list?
Message-Id: <3F7B4A9C.36AC5419@earthlink.net>



"John W. Krahn" wrote:

> Bryan wrote:
> >
> > If I have the following:
> >
> > 4 A's, 2 B's, 1 C, 3 D's
> >
> > What's the best way to create a list of -all- the possible combinations
> > of these letters?
>
> I don't know if this is the best way but:
>
> my @array = qw/ A A A A B B C D D D /;
>
> print "$_\n" for glob "{@{[ join ',', @array ]}}" x @array;
>
> :-)

I don't know why, but on my Win2000 box this gives
the error:
Unmatched right square bracket at . . .  line 6, at end of line.

I sure don't see that:

use strict;
use warnings;

y @array = qw/ A A A A B B C D D D /;

print "$_\n" for glob "{@{[ join ',', @array ]}}" x @array;

__END__




------------------------------

Date: Wed, 1 Oct 2003 21:44:44 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: How to generate this list?
Message-Id: <slrnbnmf67.a52.minceme@imap-a.start.no>

* Abigail <abigail@abigail.nl>          (CCLXXIV'th day of year MMIII)

> // > What's the best way to create a list of -all- the possible 
> // > combinations of these letters?
> //  
> //  Maybe you could use this? (untested, this'll be a long list...)
> //  
> //      #!/usr/bin/perl
> //      use strict;
> //      use warnings;
> //      use Algorithm::Permute;
> //  
> //      my $p = new Algorithm::Permute([ split //, "AAAABBCDDD" ]);
> //      while (my @res = $p->next) {
> //          print join("", @res), "\n";
> //      }
>
>
> That will do 3628800 iterations, but there are only 12600 different
> permutations.

You're right.  I need to check up on my statistics. If all ten
characters had been unique, my solution would have be correct and
give 10! = 3628800 combinations.  Here, however, the number of
different combinations are (as you say):

           10!            5 * 6 * 7 * 8 * 9 * 10     
    -----------------  = ------------------------ = 12600
    4! * 2! * 1! * 3!             2 * 6 

It doesn't look like Algorithm::Permute is best way of creating
these combinations.
-- 
                                                  (,_    ,_,    _,)
                                                  /|\`\._( )_./'/|\
                                                 · ·  \/ L /\ D  · ·
                                                /__|.-'`-\_/-`'-.|__\
`·..·´¯`·..·´¯`·..·´¯`·..·´¯`·..·´¯`·..·´¯`·.. `          "          `


------------------------------

Date: 1 Oct 2003 14:49:15 -0700
From: deals@slip-12-64-108-121.mis.prserv.net (Great Deals)
Subject: How to use proxy in Net::HTTP, not in LWP::UserAgent?
Message-Id: <cafe07c7.0310011349.75e3f4cd@posting.google.com>

I need some features that are in Net::HTTP but not in LWP::UserAgent. 

I used proxy in LWP::UserAgent, and I think LWP::UserAgent is using
Net::HTTP, but I can not find how I can use proxy in Net::HTTP
directly...


------------------------------

Date: 1 Oct 2003 12:55:53 -0700
From: toddrw69@excite.com (trwww)
Subject: Re: Make problems
Message-Id: <d81ecffa.0310011155.5c118f72@posting.google.com>

dennis@sutch.com (Dennis Sutch) wrote in message news:<f2d46235.0309271723.4e7feac5@posting.google.com>...
> I'm having problems with various make files complaining about missing
> separators (with CPANPLUS-0.044 and Digest-MD5-2.27).  I'm running
> Perl version 5.8.0, GNU Make version 3.79.1 on RedHat Linux 9.0.
> 
> One example is when attempting to make Digest-MD5-2.27:
> 
> Makefile:83: *** missing separator.  Stop.
> 
> Makefile, starting at line 82:
> 
> installhtml3dir=''
> installman1
> INSTALLSITEBIN = /usr
> INSTALLVENDORBIN = /usr/bin'
> installvendorhtml1=''
> installvendorhtml3=''
> installvendorlib='/u
> INSTALLSCRIPT = /usr/bin
> PERL_LIB = /usr/lib/perl5/5.8.0
> PERL_ARCHLIB = /usr/lib/perl5/5.8.0/i386-linux-thread-multi
> SITELIBEXP = '/usr/lib/perl5/site_perl'
> sit
> SITEARCHEXP = /usr/lib/pe
> 
> The Makefile seems to be corrupt.  Could ExtUtils::MakeMaker-6.03 be
> at fault, or is there something that could be misconfigured on my
> system?

This is because RedHat decided to make the default encoding UTF8. Take
a look at your "LANG" environment variable. Search google for:

perl redhat missing separator

There are alot of confused redhat users.

I set "LC_ALL" to C:

$ export LC_ALL=C

some on google have also suggested to set "LANG" to en_US

Todd W.


------------------------------

Date: Wed, 01 Oct 2003 18:19:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Newbie Q - Nicer way to lc something?
Message-Id: <x7fzicu8gk.fsf@mail.sysarch.com>

>>>>> "CS" == Chris Smith <chris@FLARBLEinfinitemonkeys.org.uk> writes:

  CS> lc $a;

  CS> And return the value in $a rather than $_

what return value in $_??


in general the only things that implicitly set $_ are loop contructs
(for, while( <FH> ), map, grep). i can't think of any function that will
just set $_ (i could be wrong). many functions use $_ as a default arg
which is not the same as a default return. 

  CS> $a=lc($a);

  CS> is very BASIC-like if you know what I mean.

  CS> Perhaps it's just me being fussy :/

yes.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Class in Boston - Sept 2003 -- http://www.stemsystems.com/class


------------------------------

Date: Wed, 01 Oct 2003 20:27:34 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Newbie Q - Nicer way to lc something?
Message-Id: <pan.2003.10.01.14.49.19.280683@aursand.no>

On Wed, 01 Oct 2003 14:51:05 +0100, Chris Smith wrote:
>>> Is there a nicer way of doing the following?
>>> 
>>>     $a = lc($a);
>>> 
>>> Doesn't look "perlish" if you know what I mean.

>> No.  I don't know what you mean.  What do you mean?  Do you find
>> solutions like this one more "perlish"?
>> 
>>   $a =~ tr/A-Z/a-z/;
>> 
>> If so, you shouldn't be using Perl. :-)

> I'm talking more like:
> 
> lc $a;
> 
> And return the value in $a rather than $_

Sure, but what happens when you _want_ to check the return value of lc()?

  my $str = "Don't mess with this text";
  if ( lc( $str ) eq "don't mess with this text" ) {
      # I'm not messing
  }

> Perhaps it's just me being fussy :/

Yup.


-- 
Tore Aursand <tore@aursand.no>


------------------------------

Date: Wed, 01 Oct 2003 18:37:57 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Newbie Q - Nicer way to lc something?
Message-Id: <9aFeb.10481$kD3.53@nwrdny03.gnilink.net>

Tad McClellan <tadmc@augustmail.com> wrote:
> Chris Smith <chris@FLARBLEinfinitemonkeys.org.uk> wrote:
> 
> > Is there a nicer way of doing the following?
> >     $a = lc($a);
> 
>    $a = "\Qother $1 stuff";    # OTHER $1 STUFF
> 
>    $a = "other \Q$1 stuff";    # other $1 STUFF
> 
>    $a = "other \Q$1\E stuff";  # other $1 stuff

You meant "\U" instead of "\Q" ?

-- 
Steve


------------------------------

Date: Wed, 01 Oct 2003 21:05:44 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: Newbie Q - Nicer way to lc something?
Message-Id: <8b9mnv8u2ubjc3942j8f6qugglf52v0k7d@4ax.com>

X-Ftn-To: Chris Smith 

Chris Smith <chris@FLARBLEinfinitemonkeys.org.uk> wrote:
>Is there a nicer way of doing the following?
>
>    $a = lc($a);
>
>Doesn't look "perlish" if you know what I mean.

Your example is perfectly fine unless you want to obfuscate deliberately,

$a = "\L$a"; #also fine

$_ = lc for $a; #don't do this



-- 
Matija


------------------------------

Date: 01 Oct 2003 19:47:45 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Oops, 5.8.1 broke my program
Message-Id: <slrnbnmbr0.tun.abigail@alexandra.abigail.nl>

Xaonon (xaonon@hotpop.com) wrote on MMMDCLXXXIII September MCMXCIII in
<URL:news:slrnbnmd8u.56b.xaonon@xaonon.local>:
::  Ned i bach <slrnbnl60m.dr.abigail@alexandra.abigail.nl>, Abigail
:: <abigail@abigail.nl> teithant i thiw hin: 
::  
:: > What does your program do with 5.8.0?
::  
::  I don't know.  I had 5.6.1 and went directly to 5.8.1 from there.


Well, you were claiming that 5.8.1 broke your program. And before anyone
is looking at the new things in 5.8.1, or are put of upgrading from
5.8.0 to 5.8.1, it would be useful to find out how your program behaves
in 5.8.0. Especially considering that 5.8.0 defaults to using 'perlio'
instead of 'stdio' as default.

And you also might want to try setting the environment variable
PERLIO to 'perlio' and 'stdio' repectively.


Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


------------------------------

Date: Wed, 01 Oct 2003 18:44:41 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Perl Book Recommendations
Message-Id: <3F7B2065.E07A1C6C@acm.org>

Sean O'Dwyer wrote:
> 
> Hello,
> 
> I've written some fairly complicated database software for clients based
> on the Perl I learned in "Perl 5 for Dummies" (which is non-technical in
> tone, which I like, even if it's not a particularily great Perl book)
> and using help I've received here.
> 
> Now I'm looking for something more comprehensive, something that tackles
> more complicated functions like file management, common Perl modules,
> system level tricks, etc. I'd prefer something with its chapters based
> on topics or on commands grouped by similar function, rather than, say,
> an alphabetical detailed explanation of every Perl command. I learn best
> from short examples.
> 
> Any recommendations?

Advanced Perl Programming
Perl Cookbook
Perl for System Administration
Mastering Regular Expressions
Mastering Algorithms with Perl
Network Programming with Perl
Learning Perl Objects, References & Modules
Object Oriented Perl



John
-- 
use Perl;
program
fulfillment


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5599
***************************************


home help back first fref pref prev next nref lref last post