[19256] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1451 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 6 11:05:31 2001

Date: Mon, 6 Aug 2001 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997110310-v10-i1451@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 6 Aug 2001     Volume: 10 Number: 1451

Today's topics:
    Re: Additional questions (Tad McClellan)
    Re: Allowing ONLY letters and spaces in regular express <bjoern@hoehrmann.de>
    Re: Changing user while using HTTP authentication <nomis80@linuxquebec.com>
    Re: config for @INC ... more info <dan@nospam_dtbakerprojects.com>
    Re: config for @INC ... more info <tom.melly@ccl.com>
        example: Sending e-mail from a script in MS windows <dan@nospam_dtbakerprojects.com>
    Re: Hard DBI question <bberube@versus.com>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: pdf file desc <cpryce@pryce.net>
        Perl - Reading the contents of a DIR (Pete Sohi)
    Re: Perl - Reading the contents of a DIR <dan@nospam_dtbakerprojects.com>
    Re: Perl - Reading the contents of a DIR <bart@nijlen.com>
    Re: Perl - Reading the contents of a DIR (Tad McClellan)
        Perl multithreading on WIN32 - Help needed bhakami@4tv.net
        Problems with the localtime function !!!! <vincent_le_lyonnais@yahoo.fr>
    Re: Problems with the localtime function !!!! <peter.sogaard@tjgroup.com>
    Re: Problems with the localtime function !!!! nobull@mail.com
    Re: prompting and redirection with ssh <billy_dont_try@verizon.net>
    Re: prompting and redirection with ssh <billy_dont_try@verizon.net>
        Sending e-mail from a script in MS windows <one@two.com>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: substring matching  (Tad McClellan)
    Re: Translate VB-Script into Perl <bberube@versus.com>
    Re: Uploading files to a sever. <dan@nospam_dtbakerprojects.com>
        validate IP address <a0197620@MailAndNews.com>
        Xerces XML for Windows <mark.riehl@agilecommunications.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 6 Aug 2001 09:57:03 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Additional questions
Message-Id: <slrn9mt8hf.dcu.tadmc@tadmc26.august.net>

Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>Alan Barclay wrote:
>>In article <3B6CAD56.5010302@post.rwth-aachen.de>,
>>Tassilo von Parseval  <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>>

>a subroutine is lexically scoped 


Huh?

Subroutines are NOT lexically scoped (yet).


>so assigning 
>$_ to a sub-variable in case @_ is empty will assign an empty value.
>
>What he wants is probably this, if I understood that correctly now:
>
>for (@array) {
>    mysub;
>}
>
>where mysub should automatically be called with each array-element if 
>not passed explicitely to the sub. I have not the faintest idea how this 
>could be done or whether it is possible at all.


You cannot get it called with $_ as an argument, but you can
access $_ (the package "global") just fine.


---------------------
#!/usr/bin/perl -w
use strict;

my @array = qw/zero one two three/;

for (@array) {
    mysub();
}
print "$_\n" for @array;


sub mysub {
   print "mysub(@_) was called. \$_ is '$_'\n";

   s/(\w)/\U$1/;
}
---------------------

output:

mysub() was called. $_ is 'zero'
mysub() was called. $_ is 'one'
mysub() was called. $_ is 'two'
mysub() was called. $_ is 'three'
Zero
One
Two
Three


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 06 Aug 2001 16:32:35 +0200
From: Bjoern Hoehrmann <bjoern@hoehrmann.de>
Subject: Re: Allowing ONLY letters and spaces in regular expression??
Message-Id: <3bac16c3.36834154@news.bjoern.hoehrmann.de>

* Carlos C. Gonzalez wrote in comp.lang.perl.misc:
>Given the following code why does it print out "Valid chars in string."?  
>
>In other words why does the space between "San" and "Jose" not make the 
>if expression true?
>
>my $string = "San Jose";
>
>if ($string !~ /[a-zA-Z]/) {
>  print "Invalid characters in string."
>}	  
>else {
>  print "Valid chars in string."	  
>}	  	

You want to match the whole string, so /^[a-zA-Z]*$/ would be more
appropriate. /[a-zA-Z]/ just matches a single character.
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/


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

Date: Mon, 6 Aug 2001 09:33:02 -0400
From: Simon Perreault <nomis80@linuxquebec.com>
Subject: Re: Changing user while using HTTP authentication
Message-Id: <f%wb7.14930$jc3.626943@weber.videotron.net>

On August  3, 2001 16:42, Mrvka Andreas wrote:
> yes, you think the right way!
> write a perl script like this:
> 
> print "HTTP/1.1 401 Unauthorized\n";
> print "WWW-Authenticate: Basic realm=\"my secure site\"\n\n";
> 
> this will send the browser "not-authorized" and forces to re-authenticate.

This would create the following scenario (assuming that the script is 
"/logout.cgi"):

1) Browser tries to access "/logout.cgi".
2) Server returns 401.
3) Browser asks user for another login.
4) Browser tries to access "/logout.cgi" as the new login.
5) Servers returns 401.

The fifth step should not happen. The script should redirect the user to 
the HTTP_REFERER.

In the comp.infosystems.www.authoring.cgi group, someone suggested using a 
form to send the current REMOTE_USER as a parameter to the logout script. 
The logout script would then compare that parameter with the REMOTE_USER, 
and if they are not the same it would print a Location header. This is 
fine, except that IE5 simply doesn't ask the user for a new login when it 
gets a 401. It prints Authorization Denied. So even the scenario above 
wouldn't happen on IE5, since it would not produce the third step.

I am still searching for a solution. And I'm thinking that it can't be done 
without using cookies.

-- 
Simon Perreault -- Public key: http://nomis80.dyn.dhs.org/nomis80.gpg


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

Date: Mon, 06 Aug 2001 13:20:37 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: config for @INC ... more info
Message-Id: <3B6E99F4.E09DA1D7@nospam_dtbakerprojects.com>



Tom Melly wrote:
> 
> "Dan Baker" <dan@nospam_dtbakerprojects.com> wrote in message
> news:3B6E06B2.837F07E3@nospam_dtbakerprojects.com...
> 
> <snip>
> 
> As a starting point, I would check what the assoc. action is for the .pl
> extension.
------------------------

it opens with:
C:\usr\bin\Perl.exe "%1" %*

which appears to be the same on both machines.

D


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

Date: Mon, 6 Aug 2001 15:00:29 +0100
From: "Tom Melly" <tom.melly@ccl.com>
Subject: Re: config for @INC ... more info
Message-Id: <3b6ea2fe$0$3756$ed9e5944@reading.news.pipex.net>

"Dan Baker" <dan@nospam_dtbakerprojects.com> wrote in message
news:3B6E99F4.E09DA1D7@nospam_dtbakerprojects.com...

<snip>

Compare reg settings?

HKEY_LOCAL_MACHINE/SOFTWARE/ActiveState and ./Perl ?




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

Date: Mon, 06 Aug 2001 13:37:32 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: example: Sending e-mail from a script in MS windows
Message-Id: <3B6E9DEB.60200B0C@nospam_dtbakerprojects.com>



Just Some Guy wrote:
> 
> Hi,
> 
> I need a method to send an e-mail with an attacheded file from a perl cgi
> script running on Win2K Apache Server.
----------

I ended up using MIME::Lite because can be set to work from both a win21
machine and/or a UNIX/LINUX server as well a being able to handle
attachments. One thing it does NOT do is send to multiple addresses
using either CC or BCC as far as I could tell. Here is an example
snippet:

	# email copy of order to customer and sales
	# -----

	# check OS, and set to use best available method to send
	#
    	if ( $^O =~ m/mswin32/i ) {

		MIME::Lite->send('smtp', $cSMTP , Hello=> $cSMTP , Timeout=>60 );
		# note that the Hello is required to avoid warning even though the
		# docs indicate it should not be required
    	}
 
	# compose message
	my $msg ;
	my $Recipient = "";
	my $Sender = "";

	foreach $Recipient ( $BTEmail , $cMailToOrderConfirmation ) {

		if ( $Recipient eq $BTEmail ) { $Sender = $cMailToOrderConfirmation }
		else { $Sender = $BTEmail }

    		$msg = MIME::Lite->new(
			From	=> $Sender ,
			To      => $Recipient ,
			Subject => "$cPageHeaderText Order Confirmation" ,
			Date	=> scalar(localtime) ,
			Type    =>'multipart/related'
		);

	    	$msg->attach(	Type 	=> 'text/html', 
				Data 	=> join('',@OrderHtml) );

		my $iName = "";
		my $iPath = "";
		while (( $iName , $iPath ) = each %ImageHash ) {

	    		$msg->attach(
				Type => 'image/jpg',
	                	Id   => $iName ,
	                	Path => $iPath ,
			);
		}

	    	$msg->send();
	}

================================


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

Date: Mon, 6 Aug 2001 09:29:58 -0400
From: "Neb" <bberube@versus.com>
Subject: Re: Hard DBI question
Message-Id: <qZwb7.4656$Z2.50036@nnrp1.uunet.ca>

you should use the Prepare method of the database handle, and pass it the
execute sql statement with your input parameters, like this :

$sth = $dbh->prepare('execute my_sp ?,?');
$sth->bind_param(1, $value1);
$sth->bind_param(2, $value2);
$sth->execute();

you can then run through the returned recordset using the available Fetch
methods.  Take note that you CAN'T use INOUT or OUT parameters using MSSQL.
I've tried everything, there's no way to return values other than using a
SELECT.  Though if you find one, I would like to know.

neb



"mimi" <member@dbforums.com> wrote in message
news:3b681a6f$1@usenetgateway.com...
> Hi,
>
> Sorry I can't help but you have the solution to my problems. I want to
> execute MSSQL stored procedures with input and output parameters with no
> success. I'd really appreciate it if you gave me some tips,
>
>
> Mimi
>
>
>
>
> --
> Posted via dBforums, http://dbforums.com
>




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

Date: Mon, 06 Aug 2001 13:57:25 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tmt8i5hdfdet81@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 30 Jul 2001 14:55:44 GMT and ending at
06 Aug 2001 13:59:35 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  121 (38.1% of all posters)
Articles: 201 (20.6% of all articles)
Volume generated: 345.5 kb (18.9% of total volume)
    - headers:    155.1 kb (3,219 lines)
    - bodies:     183.5 kb (6,205 lines)
    - original:   132.6 kb (4,616 lines)
    - signatures: 6.7 kb (140 lines)

Original Content Rating: 0.722

Averages
========

Posts per poster: 1.7
    median: 1 post
    mode:   1 post - 76 posters
    s:      1.5 posts
Message size: 1760.3 bytes
    - header:     790.4 bytes (16.0 lines)
    - body:       934.9 bytes (30.9 lines)
    - original:   675.4 bytes (23.0 lines)
    - signature:  34.0 bytes (0.7 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

    8    10.2 (  5.6/  4.6/  2.2)  "B. Caligari" <bcaligari@fireforged.com>
    6     9.8 (  5.2/  3.6/  1.9)  Sami Jarvinen <if.xoboi@jks.invalid>
    5     8.0 (  4.5/  3.5/  1.2)  "Oliver" <ow22@nospam-cornell.edu>
    4     7.0 (  2.9/  4.2/  2.6)  Anthony_Barker <anthony_barker@hotmail.com>
    4     6.0 (  3.0/  3.0/  1.7)  "Sean Hamilton" <sh@planetquake.com>
    4     7.7 (  3.5/  3.1/  1.9)  Ilmari Karonen <usenet11535@itz.pp.sci.fi>
    4     6.4 (  3.0/  3.4/  3.0)  Joe McMahon <mcmahon@tribal.metalab.unc.edu>
    4     5.5 (  2.8/  2.6/  1.2)  noident <noident@my-deja.com>
    4     7.0 (  2.7/  4.4/  4.3)  Les Ander <citykid@nospam.edu>
    4     7.5 (  3.9/  3.6/  2.6)  "Andrew Hamm" <ahamm@sanderson.net.au>

These posters accounted for 4.8% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  10.2 (  5.6/  4.6/  2.2)      8  "B. Caligari" <bcaligari@fireforged.com>
   9.8 (  5.2/  3.6/  1.9)      6  Sami Jarvinen <if.xoboi@jks.invalid>
   8.2 (  0.7/  7.5/  7.2)      1  Karen Mindermann <KMindermann@gmx.de>
   8.0 (  4.5/  3.5/  1.2)      5  "Oliver" <ow22@nospam-cornell.edu>
   7.8 (  1.0/  6.7/  6.6)      1  secretary@lxny.org
   7.7 (  3.5/  3.1/  1.9)      4  Ilmari Karonen <usenet11535@itz.pp.sci.fi>
   7.6 (  2.7/  4.1/  2.4)      3  Ilmari Karonen <usenet11533@itz.pp.sci.fi>
   7.5 (  3.9/  3.6/  2.6)      4  "Andrew Hamm" <ahamm@sanderson.net.au>
   7.0 (  2.9/  4.2/  2.6)      4  Anthony_Barker <anthony_barker@hotmail.com>
   7.0 (  2.7/  4.4/  4.3)      4  Les Ander <citykid@nospam.edu>

These posters accounted for 4.4% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.987  (  4.3 /  4.4)      4  Les Ander <citykid@nospam.edu>
0.886  (  1.6 /  1.8)      3  Jay McGavren <sgarfunkle@hotmail.com>
0.860  (  3.0 /  3.4)      4  Joe McMahon <mcmahon@tribal.metalab.unc.edu>
0.810  (  3.2 /  4.0)      3  Stuart Aaron White <superstu@stanford.edu>
0.763  (  2.6 /  3.4)      3  katherine <kstar8864@hotmail.com>
0.719  (  2.6 /  3.6)      4  "Andrew Hamm" <ahamm@sanderson.net.au>
0.705  (  0.9 /  1.3)      3  chiry@csua.Berkeley.EDU
0.624  (  2.6 /  4.2)      4  Anthony_Barker <anthony_barker@hotmail.com>
0.609  (  1.9 /  3.1)      4  Ilmari Karonen <usenet11535@itz.pp.sci.fi>
0.579  (  2.4 /  4.1)      3  Ilmari Karonen <usenet11533@itz.pp.sci.fi>

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.609  (  1.9 /  3.1)      4  Ilmari Karonen <usenet11535@itz.pp.sci.fi>
0.579  (  2.4 /  4.1)      3  Ilmari Karonen <usenet11533@itz.pp.sci.fi>
0.577  (  1.7 /  3.0)      4  "Sean Hamilton" <sh@planetquake.com>
0.527  (  1.9 /  3.6)      6  Sami Jarvinen <if.xoboi@jks.invalid>
0.490  (  2.2 /  4.6)      8  "B. Caligari" <bcaligari@fireforged.com>
0.457  (  1.2 /  2.6)      4  noident <noident@my-deja.com>
0.436  (  0.8 /  1.9)      3  "Manuel Körner" <manuel.koerner@rexroth.de>
0.339  (  1.1 /  3.2)      3  "Sven Köhler" <skoehler@upb.de>
0.335  (  1.2 /  3.5)      5  "Oliver" <ow22@nospam-cornell.edu>
0.327  (  1.0 /  3.1)      3  tuxy <perlgirl@cfl.rr.com>

18 posters (14%) had at least three posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      23  comp.lang.perl.modules
      19  comp.lang.perl
      13  alt.perl
       8  alt.comp.perlcgi.freelance
       3  comp.lang.perl.tk
       3  comp.databases.informix
       1  comp.text.xml
       1  comp.compilers
       1  nl.comp.os.ms-windows
       1  comp.infosystems.www.misc

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  "Andrew Hamm" <ahamm@sanderson.net.au>
       3  Obnoxio The Clown <obnoxio@hotmail.com>
       3  secretary@lxny.org
       2  666.diablo@wanadoo.fr
       1  Ilmari Karonen <usenet11535@itz.pp.sci.fi>
       1  John Stumbles <jstumbles@bluearc.com>
       1  ard@waikato.ac.nz
       1  "Brian McGee" <mcgeeb@jot.nb.ca>
       1  Ilmari Karonen <usenet11538@itz.pp.sci.fi>
       1  "Markus" <markus.cl@gmx.de>
-- 
Now, it might be true that www.mtv.com attracts more visitors and gets
more "hits" than a site that makes RFCs available. But who the fuck cares?
    -- Abigail


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

Date: Mon, 6 Aug 2001 09:53:33 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: pdf file desc
Message-Id: <G9yb7.3574$x84.709387@ruti.visi.com>

"Joe Bloggs" <joebloggs74@hotmail.com> wrote in message
news:9kgjum$scq$1@neptunium.btinternet.com...
> Bernd,
>
> > I know, this is not the correct ng, but you might know the answer...
>
> You're right, it isn't.  Try comp.text.pdf.
>
> > I am looking for the pdf file structure, because I want to create pdf
> files
> > from a program.
>
> People on this group probably use Perl's powerful PDF modules to
read/write
> such files, try searching for pdf on search.cpan.org
>
>

Also, you could try the pdflib (http://www.pdflib.com/). I've had much
better luck with version 4.0.1

cp




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

Date: 6 Aug 2001 06:18:31 -0700
From: amanpreet.sohi@sbs.siemens.co.uk (Pete Sohi)
Subject: Perl - Reading the contents of a DIR
Message-Id: <1ab8c4be.0108060518.261af107@posting.google.com>

Please forward to all PERL gurus far and wide. (thanks) :-)

Im a novice to PERL and am getting lost in the structure and
conventions used in the ActivePerl API.

I simply want to 
a) find out the number of files in a directory
b) copy them into an array of structure of some sort to be moved to
another dir.

Any help will be gratefully appreciated and if thats not
enough...here's my credit card number: 7345 8361 9346 xxxx

Thanks v.much!

Regards,

Pete.


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

Date: Mon, 06 Aug 2001 13:29:11 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: Perl - Reading the contents of a DIR
Message-Id: <3B6E9BF6.789A2B71@nospam_dtbakerprojects.com>



Pete Sohi wrote:

> I simply want to
> a) find out the number of files in a directory
> b) copy them into an array of structure of some sort to be moved to
> another dir.
--------------------
use opendir() and readdir() to get listings... or File::Find if you are
looking for particular matches. Then File::Copy copy() will probably
work for you. The docs should be in your install, or llook online at
http://www.activestate.com/

D


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

Date: Mon, 06 Aug 2001 13:35:02 GMT
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: Perl - Reading the contents of a DIR
Message-Id: <a2xb7.15946$lB.3097142@afrodite.telenet-ops.be>

> I simply want to
> a) find out the number of files in a directory
> b) copy them into an array of structure of some sort to be moved to
> another dir.

# yourdir is where your files are located
# otherdir is where your files should be copied into
# (remember the /-signs at the beginning and at the end)
$yourdir="/path/to/your/dir/";
$otherdir="/path/to/otherdir/";
$ls=`ls $yourdir`;
@arr=split /\n/, $ls;
foreach (@arr)
{`cp $yourdir$_ $otherdir`; $count++;}
print "Directory $yourdir has $count files in it.\n";
print "These files have been copied into $otherdir.\";

Regards,
Bart




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

Date: Mon, 6 Aug 2001 10:03:12 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl - Reading the contents of a DIR
Message-Id: <slrn9mt8t0.dcu.tadmc@tadmc26.august.net>

Pete Sohi <amanpreet.sohi@sbs.siemens.co.uk> wrote:

>I simply want to 
>a) find out the number of files in a directory
>b) copy them into an array of structure of some sort to be moved to
>another dir.


   opendir(DIR, $dirname) or die "could not opendir '$dirname'  $!";
   my @filenames = grep -f "$dirname/$_", readdir DIR;
   my $filecount = @filenames;
   closedir(DIR);


perldoc -f opendir
perldoc -f rename


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 06 Aug 2001 13:14:32 GMT
From: bhakami@4tv.net
Subject: Perl multithreading on WIN32 - Help needed
Message-Id: <YKwb7.288$NJ6.468@www.newsranger.com>

I am running perl (5.6.0) on Windows NT (WIN32). Can anyone tell me if any kind
of multithreading implementation is available, and where I can find it.

Many thanks.




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

Date: Mon, 6 Aug 2001 15:09:08 +0100
From: "VIN" <vincent_le_lyonnais@yahoo.fr>
Subject: Problems with the localtime function !!!!
Message-Id: <9km51n$alt$1@s1.read.news.oleane.net>

HI
 I would like to use the localtime function in my perl script. So i do :

#!/bin/perl
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

But, i obtain these errors when i run it:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
       LANGUAGE = "fr_FR:fr",
       LC_ALL = (unset),
       LC_MESSAGES = "fr_FR",
       LC_TIME = "fr_FR",
       LC_NUMERIC = "fr_FR",
       LC_CTYPE = "fr_FR",
       LC_MONETARY = "fr_FR",
       LC_COLLATE = "fr_FR",
       LANG = "fr"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

What's the problem ???

(i use perl under Linux mandrake....)

Thanks for your help!






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

Date: Mon, 6 Aug 2001 16:04:02 +0200
From: "Peter Søgaard" <peter.sogaard@tjgroup.com>
Subject: Re: Problems with the localtime function !!!!
Message-Id: <3b6ea3d9$0$52785$edfadb0f@dspool01.news.tele.dk>

> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>        LANGUAGE = "fr_FR:fr",
>        LC_ALL = (unset),
>        LC_MESSAGES = "fr_FR",
>        LC_TIME = "fr_FR",
>        LC_NUMERIC = "fr_FR",
>        LC_CTYPE = "fr_FR",
>        LC_MONETARY = "fr_FR",
>        LC_COLLATE = "fr_FR",
>        LANG = "fr"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> What's the problem ???
> (i use perl under Linux mandrake....)

Take a look at this:
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/lib/Pod/perll
ocale.html

It covers the basic use of locale in perl and also describes solutions to
your problem :)






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

Date: 06 Aug 2001 14:49:11 +0100
From: nobull@mail.com
Subject: Re: Problems with the localtime function !!!!
Message-Id: <u9wv4hwb6w.fsf@wcl-l.bham.ac.uk>

"VIN" <vincent_le_lyonnais@yahoo.fr> writes:

> But, i obtain these errors when i run it:

> What's the problem ???

When you get an error message from Perl please look at the
explaination of that error message in the "perldiag" manual before
posting to Usenet.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 06 Aug 2001 14:34:46 GMT
From: "Billy \"Bob\" Bob" <billy_dont_try@verizon.net>
Subject: Re: prompting and redirection with ssh
Message-Id: <75atmt4hc0lgq8gt7bv3s09fb02f3jr2i8@4ax.com>

On Sun, 5 Aug 2001 18:44:27 +0000 (UTC), see-sig@from.invalid (David
Efflandt) wrote:

Thanx for your response!  I appreaciate the help...

>On Sun, 05 Aug 2001, Billy \"Bob\" Bob <billy_dont_try@verizon.net> wrote:
>Maybe your psuedo tty is not /dev/tty.  For example:
>
>efflandt@compaq:~ > ssh -t mainpc tty
>/dev/pts/0

yes, this might be a problem..i don't know..

However, from page 69 of "The Unix Programming Environment": The
device /dev/tty is a synonym for your login terminal, whatever
terminal you are actually using.

>Also you were attempting to read FH opened write only.

How so?  It looked to me that I was not passing a mode to the open
call.  I was under the impression (from reading "perldoc -f open")
that when no mode is given, then the file is opened for input.  Is
that not so? 

>Try this:
>
>#!/usr/bin/perl -w
>use strict;
>my ($tty, $oldfh, $reply);
>chomp($tty = `tty`) || die "no tty";
>open (FH, "+< $tty") || die "can't open $tty: $!";  # read/write
>$oldfh = select(FH); $| = 1; select($oldfh);	# unbuffer FH
>print FH "Prompt on $tty\nFeed me: ";
>if (defined($reply = <FH>)) { chomp $reply; }	# single line
># while (defined($_ = <FH>)) { $reply .= $_; }	# multiline  
>if ($reply) {
>    print FH "You entered: $reply\n";
>} else {
>    print FH "no input received\n";
>}
>close FH;
>
>efflandt@compaq:~ > ssh -t mainpc ./input.pl
>Prompt on /dev/pts/1
>Feed me: It works!
>You entered: It works!
>Connection to mainpc.localdomain closed.

I tried this, and it worked like you showed.  However, what happens if
I redirect the output?  When redirected I would like the prompt to
show up to the user, but what they type to show up in the redirected
file.  I probably wasn't very clear on this in my original post.  For
example:

$ ssh -t mainpc ./input.pl > a
Prompt on /dev/pts/1
Feed me: It works!
$ cat a
You entered: It works!

That is what I want, but with my code and what you posted this
happens:
$ ssh -t mainpc ./input.pl > a
$ cat a
Feed me: It works!
You entered: It works!

Ack!  Both the prompt and the output show up in the re-directed
output.


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

Date: Mon, 06 Aug 2001 14:50:16 GMT
From: "Billy \"Bob\" Bob" <billy_dont_try@verizon.net>
Subject: Re: prompting and redirection with ssh
Message-Id: <2kbtmtc6mdsrtigha9i7bd2obqt33c64u9@4ax.com>

On Mon, 6 Aug 2001 02:42:30 +0000 (UTC), see-sig@from.invalid (David
Efflandt) wrote:

>I did some further testing and you don't even need to worry about a tty 
>since apparently STDIN and STDOUT are automatically piped through ssh 
>(OpenSSH), although, then TERM=dumb.  Example:
>
>#!/usr/bin/perl -w
>use strict;
>my($reply);
>$| = 1;
>print "Feed me: ";
>if (defined($reply = <STDIN>)) { chomp $reply; }        # single line
># while (defined($_ = <STDIN>)) { $reply .= $_; }       # multiline
>if ($reply) {
>    print "You entered: $reply\n";
>} else {
>    print "No input received\n";
>}
>
>efflandt@compaq:~ > ssh mainpc ./input2.pl
>Feed me: This works too!
>You entered: This works too!

Interesting approach; however, it appears to have the same output
redirection pitfall that was noted in the previous message.


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

Date: Mon, 6 Aug 2001 15:17:01 +0200
From: "Just Some Guy" <one@two.com>
Subject: Sending e-mail from a script in MS windows
Message-Id: <9km59f$leg$1@mosquito.HL.Siemens.DE>

Hi,

I need a method to send an e-mail with an attacheded file from a perl cgi
script running on Win2K Apache Server.

Any help on this would be appreciated.

Thanks in advance,
Me, Myself and I.




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

Date: Mon, 06 Aug 2001 13:57:21 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <tmt8i1n3d4ss7e@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 30 Jul 2001 14:55:44 GMT and ending at
06 Aug 2001 13:59:35 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org

Totals
======

Posters:  318
Articles: 977 (386 with cutlined signatures)
Threads:  298
Volume generated: 1826.2 kb
    - headers:    799.9 kb (15,935 lines)
    - bodies:     967.4 kb (32,402 lines)
    - original:   616.8 kb (22,173 lines)
    - signatures: 57.9 kb (1,396 lines)

Original Content Rating: 0.638

Averages
========

Posts per poster: 3.1
    median: 2.0 posts
    mode:   1 post - 154 posters
    s:      5.2 posts
Posts per thread: 3.3
    median: 2.0 posts
    mode:   1 post - 96 threads
    s:      3.9 posts
Message size: 1914.1 bytes
    - header:     838.4 bytes (16.3 lines)
    - body:       1013.9 bytes (33.2 lines)
    - original:   646.5 bytes (22.7 lines)
    - signature:  60.7 bytes (1.4 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   48   115.5 ( 43.3/ 71.0/ 53.5)  "Godzilla!" <godzilla@stomp.stomp.tokyo>
   43    90.4 ( 44.3/ 36.2/ 15.5)  Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
   34    47.2 ( 29.0/ 17.9/  9.7)  Bart Lateur <bart.lateur@skynet.be>
   26    48.5 ( 21.2/ 26.5/  8.3)  "John W. Krahn" <krahnj@acm.org>
   26    46.3 ( 19.1/ 27.2/ 12.7)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   21    55.4 ( 16.3/ 39.1/ 24.5)  Yves Orton <demerphq@hotmail.com>
   19    40.1 ( 21.4/ 16.0/  9.9)  tadmc@augustmail.com
   18    33.9 ( 14.4/ 12.8/  5.4)  Ilya Martynov <ilya@martynov.org>
   17    30.4 ( 13.2/ 15.8/  7.0)  nobull@mail.com
   15    27.3 (  9.9/ 13.3/  6.2)  Randal L. Schwartz <merlyn@stonehenge.com>

These posters accounted for 27.3% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 115.5 ( 43.3/ 71.0/ 53.5)     48  "Godzilla!" <godzilla@stomp.stomp.tokyo>
  90.4 ( 44.3/ 36.2/ 15.5)     43  Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
  55.4 ( 16.3/ 39.1/ 24.5)     21  Yves Orton <demerphq@hotmail.com>
  48.5 ( 21.2/ 26.5/  8.3)     26  "John W. Krahn" <krahnj@acm.org>
  47.2 ( 29.0/ 17.9/  9.7)     34  Bart Lateur <bart.lateur@skynet.be>
  46.3 ( 19.1/ 27.2/ 12.7)     26  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  40.1 ( 21.4/ 16.0/  9.9)     19  tadmc@augustmail.com
  35.4 (  7.2/ 27.8/ 15.7)      9  Benjamin Goldberg <goldbb2@earthlink.net>
  33.9 ( 14.4/ 12.8/  5.4)     18  Ilya Martynov <ilya@martynov.org>
  31.6 ( 13.9/ 14.9/ 14.1)     15  abigail@foad.org

These posters accounted for 29.8% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.999  ( 11.0 / 11.0)      6  Bernie Cosell <bernie@fantasyfarm.com>
0.948  ( 14.1 / 14.9)     15  abigail@foad.org
0.943  (  6.1 /  6.5)      6  BCC <a@b.c>
0.933  ( 10.3 / 11.1)      6  Dan Baker <dan@nospam_dtbakerprojects.com>
0.835  (  3.8 /  4.5)      5  Mark Jason Dominus <mjd@plover.com>
0.790  (  3.8 /  4.8)      5  "Dave Stafford" <Dave.Stafford@globis.net>
0.753  ( 53.5 / 71.0)     48  "Godzilla!" <godzilla@stomp.stomp.tokyo>
0.724  (  2.4 /  3.3)      5  fred58
0.724  (  3.9 /  5.4)      6  Mark Johnson <crvmp3@hotmail.com>
0.707  (  7.5 / 10.6)     10  Jeff Zucker <jeff@vpservices.com>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.466  (  2.2 /  4.7)      7  John Joseph Trammell <trammell@bayazid.hypersloth.invalid>
0.450  (  3.7 /  8.2)      9  Michael Budash <mbudash@sonic.net>
0.439  (  7.0 / 15.8)     17  nobull@mail.com
0.429  ( 15.5 / 36.2)     43  Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
0.423  (  3.6 /  8.4)      9  gnari <gnarinn@hotmail.com>
0.423  (  5.4 / 12.8)     18  Ilya Martynov <ilya@martynov.org>
0.383  (  2.9 /  7.7)      9  "Nathan Randle" <nathan.randle@ntlworld.com>
0.335  (  1.2 /  3.5)      5  "Oliver" <ow22@nospam-cornell.edu>
0.313  (  8.3 / 26.5)     26  "John W. Krahn" <krahnj@acm.org>
0.251  (  1.8 /  7.2)      7  dbe@todbe.com

42 posters (13%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   27  newbe question splitting a string into two different variables
   21  comp.infosystems.www.authoring.cgi now moderated
   15  join lines ?
   15  Help with an array and foreach
   15  Having some trouble with map
   14  Splitting a text list into smaller lists?
   13  negative lookahead
   12  Strange problem...
   10  What's the  regular expression to check emails and to remove html
   10  Setting DOS Variables (Was: Matt Wrights formmail alert)

These threads accounted for 15.6% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  52.7 ( 26.7/ 24.7/ 12.9)     27  newbe question splitting a string into two different variables
  46.4 ( 20.5/ 24.1/ 14.5)     21  comp.infosystems.www.authoring.cgi now moderated
  39.5 ( 11.8/ 27.2/ 14.4)     14  Splitting a text list into smaller lists?
  38.5 ( 12.7/ 25.8/ 20.2)     15  join lines ?
  30.2 (  4.0/ 25.5/ 14.9)      5  Telnet/MUD server
  29.1 (  9.9/ 18.8/ 13.9)     10  Setting DOS Variables (Was: Matt Wrights formmail alert)
  27.7 (  9.6/ 16.9/ 10.5)     12  Strange problem...
  26.9 ( 12.8/ 12.4/  9.5)     15  Having some trouble with map
  24.0 ( 12.6/ 11.1/  6.7)     15  Help with an array and foreach
  21.7 (  7.4/ 13.8/ 11.6)      9  Cleaning replacing the value of a constant

These threads accounted for 18.4% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.841  ( 11.6/  13.8)      9  Cleaning replacing the value of a constant
0.813  (  6.1/   7.5)      7  Finding "this" but not "this and that" with a regex?
0.798  (  8.7/  10.9)      7  Problems with with Perl, Cgi using the Dbi module
0.784  ( 20.2/  25.8)     15  join lines ?
0.776  (  7.0/   9.0)     10  What's the  regular expression to check emails and to remove html
0.768  (  9.5/  12.4)     15  Having some trouble with map
0.758  (  9.2/  12.1)      9  Optimum Sum?
0.752  (  1.7/   2.3)      5  active state and CGI?
0.737  ( 13.9/  18.8)     10  Setting DOS Variables (Was: Matt Wrights formmail alert)
0.736  (  5.8/   7.8)      6  Using CSS with CGI.pm

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.451  (  2.9 /  6.4)      7  Script works on PWS but not IIS?
0.449  (  1.7 /  3.8)      7  Finding keywords in text files
0.443  (  1.4 /  3.2)      7  PERL binaries for version 5.005_03
0.442  (  2.7 /  6.0)      7  PERL system function and variables
0.438  (  3.5 /  7.9)      9  Additional questions
0.438  (  3.3 /  7.4)      6  reading and writing arrays
0.437  (  1.8 /  4.0)      7  Reporting Questionable Programming Activity
0.418  (  1.0 /  2.5)      5  counting
0.416  (  2.6 /  6.1)      5  Regex library?
0.373  (  1.5 /  3.9)      7  automatic array elements

67 threads (22%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      23  comp.lang.perl.modules
      19  comp.lang.perl
      13  alt.perl
       8  alt.comp.perlcgi.freelance
       3  comp.lang.perl.tk
       3  comp.databases.informix
       1  comp.text.xml
       1  comp.compilers
       1  nl.comp.os.ms-windows
       1  comp.infosystems.www.misc

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  "Andrew Hamm" <ahamm@sanderson.net.au>
       6  Smiley <gurm@intrasof.com>
       5  "Dave Stafford" <Dave.Stafford@globis.net>
       5  Johan Vromans <JVromans@Squirrel.nl>
       4  Michael Carman <mjcarman@home.com>
       3  lvirden@yahoo.com
       3  "Jay Flaherty" <fty@mediapulse.com>
       3  Randall Woodman <rwoodman_nospam_@verio.net>
       3  Yves Orton <demerphq@hotmail.com>
       3  abigail@foad.org
-- 
Whenever the government fails to prevent a plane crash, the event is
cited as justification for having the government prevent plane crashes.
    -- Harry Browne


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

Date: Mon, 6 Aug 2001 09:48:22 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: substring matching 
Message-Id: <slrn9mt816.dcu.tadmc@tadmc26.august.net>

fishy <joerivdv007@hotmail.com> wrote:
>
>I need to match a substring from a string which contains non-alphanumeric
>characters and assing a variable to them or push them to a list.


[snip pseudo code that does not come close to explaining what is wanted ]

>The normal string that contains 'alpha' looks like this:
>alpha('verb'),


So you want to extract the characters following "alpha('" up
until "')"  ?


>The above expressions work when the string only contains the
>characters[a-zA-Z]. 


The above (snipped) expressions can never work, I dunno what you are 
saying here...


>The problem with the above statements is that they do not return anything.
>If I state $alpha = substr(alpha, 0, 4); then I get the expected return.
                            ^^^^^
                            ^^^^^ barewords are bad, quote your strings


You should *always* enable warnings when developing Perl code.


      print "$1\n" while /alpha\('([^']+)/g;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 6 Aug 2001 09:48:24 -0400
From: "Neb" <bberube@versus.com>
Subject: Re: Translate VB-Script into Perl
Message-Id: <Iexb7.4665$Z2.50531@nnrp1.uunet.ca>


"Axel Weiß" <axel.dieter.weiss@t-online.de> wrote in message
news:9klkcu$8s1$05$1@news.t-online.com...
> I've to write a perl-programm that install printer on a W2K-Printserver. I
> use from the ResourceKit the PRNADMIN.DLL. There are a sample sourcecode
> (VisualBasic-Script) in the Doku to check the installed Printerdriver. I
> don't know how to translate this to perl, special the marked line.
>
> dim oMaster
> dim oDriver
> Rem creating the PrintMaster object
> set oMaster = CreateObject("PrintMaster.PrintMaster.1")
> Rem the property that enumerates drivers take an optional parameter for
> server name
> Rem if it is missing, the drivers on the local computer will be enumerated
> for each oDriver in oMaster.Drivers("\\Servername")
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> [...]

How are you creating your object in Perl?  Maybe WIN32::OLE can help...

neb





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

Date: Mon, 06 Aug 2001 13:18:27 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: Uploading files to a sever.
Message-Id: <3B6E9973.283C7F1A@nospam_dtbakerprojects.com>

I *just* posted a detailed example yesterday... use google to search for
a thread with subject containing upload...

D


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

Date: Mon, 6 Aug 2001 10:01:10 -0400
From: Jag Man <a0197620@MailAndNews.com>
Subject: validate IP address
Message-Id: <3B91180F@MailAndNews.com>

I have an IP variable with default value 000.000.000.000 I needs to verify 
that the input value for this variable is a valid IP address.

Need a shortest possible subroutine.

TIA!

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------



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

Date: Mon, 06 Aug 2001 14:25:34 GMT
From: "Mark Riehl" <mark.riehl@agilecommunications.com>
Subject: Xerces XML for Windows
Message-Id: <yNxb7.8796$AK6.2267815@typhoon2.gnilink.net>

All -

Is anyone using the Xerces Perl parser for Windows?  If so, are there any
tricks I need to know about to get it to compile under Windows?

Thanks,
Mark




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

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 1451
***************************************


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