[16603] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4015 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 14 21:05:27 2000

Date: Mon, 14 Aug 2000 18:05:15 -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: <966301515-v9-i4015@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 14 Aug 2000     Volume: 9 Number: 4015

Today's topics:
    Re: "Setting locale failed" error on 5.6 rpm upgrade <koohler@algonet.se>
    Re: "Setting locale failed" error on 5.6 rpm upgrade <kwythers@forestry.umn.edu>
        - Using run time value as arry names???? <taboo@comcen.com.au>
    Re: - Using run time value as arry names???? <bkennedy@hmsonline.com>
    Re: Array Printing (Logan Shaw)
        being able to change the name of a file on the server,  <star@sonic.net>
    Re: Can't call a script from html created by another sc <rsouthgate@hotmail.com>
    Re: chmod question (u2orange)
    Re: Convert URLs to links (Decklin Foster)
    Re: currency format (u2orange)
        Fork and Pipes <burra@colorado.edu>
        Help! How to connect two string to one. (Empty) <zhangkai@bj.tom.com>
    Re: Help! How to connect two string to one. (Empty) <lr@hpl.hp.com>
    Re: Help! How to connect two string to one. (Empty) <taboo@doofa.net>
    Re: hows this? (Tony L. Svanstrom)
        Large Pieces of Code <studentfl@hotmail.com>
    Re: London =?iso-8859-1?Q?=A330-35K?= Perl Programmers  <flavell@mail.cern.ch>
    Re: Mail with attachments (Teodor Zlatanov)
    Re: Message board code <occitan@esperanto.org>
    Re: Negativity in Newsgroup -- Solution (Logan Shaw)
    Re: Negativity in Newsgroup...Newbie Perspective (John Stanley)
    Re: Perfect Place to find Perl Jobs <sammytalinNOsaSPAM@usa.com.invalid>
    Re: Perlshop having probs with sendmail in Win98 <uscphysics@hotmail.com>
    Re: Print formatted output to variable (Damian Conway)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 15 Aug 2000 00:03:53 +0200
From: Magnus =?iso-8859-1?Q?K=F6=F6hler?= <koohler@algonet.se>
Subject: Re: "Setting locale failed" error on 5.6 rpm upgrade
Message-Id: <39986CC9.E995EF33@algonet.se>

Hello.

I had much problem with that to,
but find out this:

This is for RedHat 6.2 users ,I don't now if it works with any other
distr.:

In my .bash_profile (or .bash) file I write this:

export LANGUAGE="sv_SE"
export LANG="sv_SE"
export LC_ALL="sv_SE"

(This is for swedish language)

Use your language instead. You can find it in your locale-library.
(search for locale)


"Kirk R. Wythers" wrote:
> 
> When I installed 5.6 (via an rpm) I got the following error:
> 
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>  LANGUAGE = (unset),
>  LC_ALL = (unset),
>  LANG = "(null)"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> 
> I'm not sure what I should do next. Can someone point me in the right
> direction to get these "local settings" set?
> 
> Thanks,  Kirk
> 
> --
> Kirk R. Wythers                                  University of Minnesota
> Email: kwythers@forestry.umn.edu                 Department of Forest Resources
> Tel: 612.625.22611530                            Cleveland Ave. N.
> Fax: 612 625.5212                                Saint Paul,  MN 55108


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

Date: Mon, 14 Aug 2000 17:44:00 -0500
From: "Kirk R. Wythers" <kwythers@forestry.umn.edu>
Subject: Re: "Setting locale failed" error on 5.6 rpm upgrade
Message-Id: <39987630.ED813120@forestry.umn.edu>

Thanks... when I got home I checked my machine there (it's working fine). The
command "locale" gave the following:

LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_ALL=

I'll double chech .bacsh, but I'll bet that's the problem...

Kirk


Magnus Kööhler wrote:

> Hello.
>
> I had much problem with that to,
> but find out this:
>
> This is for RedHat 6.2 users ,I don't now if it works with any other
> distr.:
>
> In my .bash_profile (or .bash) file I write this:
>
> export LANGUAGE="sv_SE"
> export LANG="sv_SE"
> export LC_ALL="sv_SE"
>
> (This is for swedish language)
>
> Use your language instead. You can find it in your locale-library.
> (search for locale)
>
> "Kirk R. Wythers" wrote:
> >
> > When I installed 5.6 (via an rpm) I got the following error:
> >
> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> >  LANGUAGE = (unset),
> >  LC_ALL = (unset),
> >  LANG = "(null)"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
> >
> > I'm not sure what I should do next. Can someone point me in the right
> > direction to get these "local settings" set?
> >
> > Thanks,  Kirk
> >
> > --
> > Kirk R. Wythers                                  University of Minnesota
> > Email: kwythers@forestry.umn.edu                 Department of Forest Resources
> > Tel: 612.625.22611530                            Cleveland Ave. N.
> > Fax: 612 625.5212                                Saint Paul,  MN 55108



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

Date: 14 Aug 2000 22:27:43 +1000
From: "Kiel Stirling" <taboo@comcen.com.au>
Subject: - Using run time value as arry names????
Message-Id: <3997e5bf_1@nexus.comcen.com.au>


Hi all 
Can I use a value stored in a variable as an arry name?

$buffer{$username}=\@($username)files 

Kiel ..


 
 


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

Date: Tue, 15 Aug 2000 00:54:55 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: - Using run time value as arry names????
Message-Id: <zx0m5.102209$A%3.1359090@news1.rdc2.pa.home.com>


"Kiel Stirling" <taboo@comcen.com.au> wrote in message
news:3997e5bf_1@nexus.comcen.com.au...
>
> Hi all
> Can I use a value stored in a variable as an arry name?

This is a frequently asked question and is explicitly answered in the FAQ -
I'm sure it can explain it better than me.

perldoc perlfaq7

--Ben Kennedy




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

Date: 14 Aug 2000 17:23:22 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Array Printing
Message-Id: <8n9rgq$3v6$1@provolone.cs.utexas.edu>

In article <39984B9A.CDA18AE0@attglobal.net>,
Drew Simonis  <care227@attglobal.net> wrote:
>marxjkj123@my-deja.com wrote:
>> for ($x = 0; $x < @block; $x++){
>>                 print $block[$x],"\n";
>>         }
>> 
>
>the above is better written as:
>
>for (@block)
>{
>	print;
>}

Or,

	print @block;

Or, to add the newlines:

	print map ("$_\n", @block);

  - Logan


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

Date: Mon, 14 Aug 2000 22:38:41 GMT
From: arthur <star@sonic.net>
Subject: being able to change the name of a file on the server, and open it while keeping the old name
Message-Id: <B5BD1A3D.5687%star@sonic.net>

Hi all,

Suppose there is a file that runs in a learning application on a server and
I want different people to be able to change that file and save the version
they changed as their own but not erase the other peoples version?

In other words:
Lets say GAME uses: filex. filex is on a server with public priviliges so
people can change that part of the game. I want a perl script that will
allow people to chage filex and save it with the name they want but it will
still be known as filex because that is what GAME needs to run.

I hope that is  clear. Does anyone know of a script like that?

or if I were to write one I think I would use a symlink
but I have never used one before so any help is appreciated!

Thanks,
~arthur
star@sonic.net



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

Date: Mon, 14 Aug 2000 23:40:38 +0100
From: "Rob" <rsouthgate@hotmail.com>
Subject: Re: Can't call a script from html created by another script
Message-Id: <8n9s8c$g0k$1@news5.svr.pol.co.uk>


> You don't give any information that might tell us where the problem is,
> you don't even talk about Perl once... and you expect people here to
> solve your problem?????
>
> If it's a Perl-problem, then you post the code.

Apologies, I was hoping it would be simple enough so I needn't bother, but
here is the code;
First script (mandpsearch.pl)


#!c:/perl/bin/perl.exe


use CGI::Carp qw(fatalsToBrowser);

#---------Change the input form data into useable strings---------#

&parse;

$type_of_work = $FORM{'type_of_work'};

#Splitting a few form inputs into max and min values from ranges

($min_height, $max_height,) = split /-/, $FORM{'Height'};

($min_age, $max_age,) = split /-/, $FORM{'age'};

#---------DATABASE ACCESS COMMAND MODULE-----------#

use DBI;

#count number of matches
$countsearch =<<EOT;
SELECT Count(*) FROM models WHERE age >= ? and age <= ? and Gender LIKE ?
and Height >= ? and Height <= ? and Waist LIKE ? and Shoe LIKE ? and Eyes
LIKE ? and Hair LIKE ? and Bust LIKE ? and Hips LIKE ? and Inside_leg LIKE ?
and Outside_leg LIKE ? and Dress LIKE ? and Gloves LIKE ? and $type_of_work
LIKE ?
EOT

#get a row of the dbase
$search =<<EOT;
SELECT * FROM models WHERE age >= ? and age <= ? and Gender LIKE ? and
Height >= ? and Height <= ? and Waist LIKE ?  and Shoe LIKE ? and Eyes LIKE
? and Hair LIKE ? and Bust LIKE ? and Hips LIKE ? and Inside_leg LIKE ? and
Outside_leg LIKE ? and Dress LIKE ? and Gloves LIKE ? and $type_of_work LIKE
?
EOT

my $dbh = DBI->connect('DBI:ODBC:mandp')
or die "Couldn't connect to database: " . DBI->errstr;

my $sth = $dbh->prepare($search)
or die "Couldn't prepare statement: " . $dbh->errstr;

my $sthcount = $dbh->prepare($countsearch)
 or die "couldn't prepare statement: " . $dbh->errstr;

#execute the count of matches straightaway with the form inputs
$sthcount->execute($min_age,$max_age,$FORM{'Gender'},$min_height,$max_height
,$FORM{'Waist'},$FORM{'Shoe'},$FORM{'Eyes'},$FORM{'Hair'},$FORM{'Bust'},$FOR
M{'Hips'},$FORM{'Inside_leg'},$FORM{'Outside_leg'},$FORM{'Dress'},$FORM{'Glo
ves'},"Yes")
or die "couldn't execute statement: " . $sthcount->errstr;
while (@data = $sthcount->fetchrow_array) {
  $count = $data[0];
 }

$record = $FORM{'record'};

#PREVIOUS only applies if viewer hits previous button in created html below,
#by taking two off essentially it decrements the already incremented record
number
#increment by one automatic so assuming a next button is pressed
&previous if $FORM{'button'};

sub previous {
$record = $FORM{'record'}-2;
}

#set the loop up and get a row from database
$loop = 0;
$sth->execute($min_age,$max_age,$FORM{'Gender'},$min_height,$max_height,$FOR
M{'Waist'},$FORM{'Shoe'},$FORM{'Eyes'},$FORM{'Hair'},$FORM{'Bust'},$FORM{'Hi
ps'},$FORM{'Inside_leg'},$FORM{'Outside_leg'},$FORM{'Dress'},$FORM{'Gloves'}
,"Yes")
or die "couldn't execute statement: " . $sth->errstr;

while (@data = $sth->fetchrow_array) {
  $ID = $data[0];
  $age = $data[1];
                $name = $data[3];
  $file = $data[2];
  $Gender = $data[4];
  $Height = $data[5];
  $Waist = $data[6];
  $Shoe = $data[7];
  $Eyes = $data[8];
  $Hair = $data[9];
  $Bust = $data[10];
  $Hips = $data[11];
  $Inside_leg = $data[12];
  $Outside_leg = $data[13];
  $Dress = $data[14];
  $Gloves = $data[15];
#increment loop here so that first run through loop is one
#check to see if it is the same as the record number
#if it is we use that row of data if not get next row and check again
                $loop++;
                if ($loop eq $record) {
#once settled on a row increment the record number ready for next use
  $record++;
                last;
                }
 }
#since record already incremented for next use set new variable for html
display
$disprecord = $record - 1;


#sub to display a page if no rows match up
&nomatch if ($sth->rows == -1);

#---------HTML CODE FOR THIRD ADD USER PAGE---------#

print "Content-type: text/html\n\n";

print <<EOF;

<html>

<head>
<title>models</title>
<body bgcolor="#000000">
<form method="post"
action="http://ntscripts.businessserve.co.uk/scripts/mandporder.pl">
<input type="hidden" name="age" value="$FORM{'age'}">
<input type="hidden" name="record" value="$record">
<input type="hidden" name="file" value="$file">
<input type="hidden" name="Gender" value="$FORM{'Gender'}">
<input type="hidden" name="Height" value="$FORM{'Height'}">
<input type="hidden" name="Waist" value="$FORM{'Waist'}">
<input type="hidden" name="Shoe" value="$FORM{'Shoe'}">
<input type="hidden" name="Eyes" value="$FORM{'Eyes'}">
<input type="hidden" name="Hair" value="$FORM{'Hair'}">
<input type="hidden" name="Bust" value="$FORM{'Bust'}">
<input type="hidden" name="Hips" value="$FORM{'Hips'}">
<input type="hidden" name="Inside_leg" value="$FORM{'Inside_leg'}">
<input type="hidden" name="Outside_leg" value="$FORM{'Outside_leg'}">
<input type="hidden" name="Dress" value="$FORM{'Dress'}">
<input type="hidden" name="Gloves" value="$FORM{'Gloves'}">
<input type="hidden" name="type_of_work" value="$FORM{'type_of_work'}">
<input type="hidden" name="ID" value="$ID"><div align="center">
<input type="submit" value="Request this model" ></td>
</form>
<form method="post"
action="http://ntscripts.businessserve.co.uk/scripts/mandpsearch.pl">
<input type="hidden" name="age" value="$FORM{'age'}">
<input type="hidden" name="record" value="$record">
<input type="hidden" name="file" value="$file">
<input type="hidden" name="Gender" value="$FORM{'Gender'}">
<input type="hidden" name="Height" value="$FORM{'Height'}">
<input type="hidden" name="Waist" value="$FORM{'Waist'}">
<input type="hidden" name="Shoe" value="$FORM{'Shoe'}">
<input type="hidden" name="Eyes" value="$FORM{'Eyes'}">
<input type="hidden" name="Hair" value="$FORM{'Hair'}">
<input type="hidden" name="Bust" value="$FORM{'Bust'}">
<input type="hidden" name="Hips" value="$FORM{'Hips'}">
<input type="hidden" name="Inside_leg" value="$FORM{'Inside_leg'}">
<input type="hidden" name="Outside_leg" value="$FORM{'Outside_leg'}">
<input type="hidden" name="Dress" value="$FORM{'Dress'}">
<input type="hidden" name="Gloves" value="$FORM{'Gloves'}">
<input type="hidden" name="type_of_work" value="$FORM{'type_of_work'}">
EOF

if ($disprecord eq 1) {
print <<EOF;
<input type="submit" name="other" value="Next Model">
EOF
}

elsif ($disprecord gt 1 and $disprecord lt $count) {
print <<EOF;
  <input type="submit" name="button" value="Previous Model"><input
type="submit" name="other" value="Next Model"></a></td>
    EOF
}

elsif ($disprecord eq $count) {
print <<EOF;
  <input type="submit" name="button" value="Previous Model">
EOF
}

print <<EOF;
</form>
</BODY>
</HTML>

EOF

exit;

#---------Function that tells user there is no matching models--------#

sub nomatch {

print "Content-type: text/html\n\n";

print <<"EOF";

<html>
<body>
No matching models
</body>

</html>


EOF

exit;

}

#---------Function that takes form data and changes to string data---------#

sub parse {

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);

   # Un-Webify plus signs and %-encoding
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;

   if ($allow_html != 1) {
      $value =~ s/<([^>]|\n)*>//g;
   }

   $FORM{$name} = $value;
 }
}

exit;

#---------####---------#

and the second script:



#!c:/perl/bin/perl.exe

use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);

#---------Change the input form data into useable strings---------#

&parse;

#----------------Using a cookie to keep track of users request--------#

#if present user already made request
#so we need to find out what was requested and add latest to request

$basket = cookie('basket');
if ($basket) {
@request = split(/,/,$basket);
}

#each time checks to see if the model being added is already there
for ($x=0; $x<@request; $x++){
 if ($FORM{'ID'} eq $request[$x]) {
 $check="duplicate";
 }
}

#assuming negative result above model added to array
unless ($check eq "duplicate") {
$request[@request+1] = $FORM{'ID'};
}

if ($FORM{'model'}) {
 for ($x=0; $x<@request; $x++) {
  if ($FORM{'model'} eq $request[$x]) {
  $request[$x] = " ";
  }
 }
}

$basket=join(",",@request);

#set or reset cookie
$cookie = cookie( -name=>'basket',
   -value=>$basket,
   -path=>'/');
print header(-cookie=>$cookie);

#---------DATABASE ACCESS COMMAND MODULE-----------#

use DBI;

my $dbh = DBI->connect('DBI:ODBC:mandp')
or die "Couldn't connect to database: " . DBI->errstr;

my $sth = $dbh->prepare('SELECT * FROM models WHERE ID = ?')
or die "Couldn't prepare statement: " . $dbh->errstr;


$retrecord = $FORM{'record'} - 1;

# HTML RETURNED

print "Content-type: text/html\n\n";

print <<EOF;

<html>

<head>
<title>YOUR REQUEST SO FAR CONSISTS OF THE FOLLOWING MODELS</title>
</head>

<body bgcolor="#000000">
<form action="http://ntscripts.businessserve.co.uk/scripts/mandporder.pl"
method="post">
EOF

for ($x = 0; $x < @request; $x++) {

#displays a review of each model in cookie

$sth->execute($request[$x]);
while (@data = $sth->fetchrow_array) {
  $modelid = $data[0];
  $modelname = $data[3];
  $modelage = $data[1];
  $file = $data[2];
print <<EOF;
<input type="radio" name="model" value="$modelid">$modelname
EOF
 }
}

print <<EOF;
<input type="hidden" name="record" value=$FORM{'record'}>
<input type="hidden" name="age" value=$FORM{'age'}>
<input type="hidden" name="Gender" value="$FORM{'Gender'}">
<input type="hidden" name="Height" value="$FORM{'Height'}">
<input type="hidden" name="Waist" value="$FORM{'Waist'}">
<input type="hidden" name="Shoe" value="$FORM{'Shoe'}">
<input type="hidden" name="Eyes" value="$FORM{'Eyes'}">
<input type="hidden" name="Hair" value="$FORM{'Hair'}">
<input type="hidden" name="Bust" value="$FORM{'Bust'}">
<input type="hidden" name="Hips" value="$FORM{'Hips'}">
<input type="hidden" name="Inside_leg" value="$FORM{'Inside_leg'}">
<input type="hidden" name="Outside_leg" value="$FORM{'Outside_leg'}">
<input type="hidden" name="Dress" value="$FORM{'Dress'}">
<input type="hidden" name="Gloves" value="$FORM{'Gloves'}">
<input type="hidden" name="type_of_work" value="$FORM{'type_of_work'}">
<input type="image" border="0" src="/images/butyel.gif">
</form>
<br><br>
<form method="post"
action="http://ntscripts.businessserve.co.uk/scripts/mandpsearch.pl">
<input type="hidden" name="age" value=$FORM{'age'}>
<input type="hidden" name="record" value=$retrecord>
<input type="hidden" name="Gender" value="$FORM{'Gender'}">
<input type="hidden" name="Height" value="$FORM{'Height'}">
<input type="hidden" name="Waist" value="$FORM{'Waist'}">
<input type="hidden" name="Shoe" value="$FORM{'Shoe'}">
<input type="hidden" name="Eyes" value="$FORM{'Eyes'}">
<input type="hidden" name="Hair" value="$FORM{'Hair'}">
<input type="hidden" name="Bust" value="$FORM{'Bust'}">
<input type="hidden" name="Hips" value="$FORM{'Hips'}">
<input type="hidden" name="Inside_leg" value="$FORM{'Inside_leg'}">
<input type="hidden" name="Outside_leg" value="$FORM{'Outside_leg'}">
<input type="hidden" name="Dress" value="$FORM{'Dress'}">
<input type="hidden" name="Gloves" value="$FORM{'Gloves'}">
<input type="hidden" name="type_of_work" value="$FORM{'type_of_work'}">
<input type="image" name="return" src="/images/butyel.gif">
</form>
<form method="post"
action="http://ntscripts.businessserve.co.uk/scripts/comporder.pl"><input
type="image" border="0" src="/images/butyel.gif">
</body>

</html>

EOF

exit;

#---------Function that takes form data and changes to string data---------#

sub parse {

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);

   # Un-Webify plus signs and %-encoding
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;

   if ($allow_html != 1) {
      $value =~ s/<([^>]|\n)*>//g;
   }

   $FORM{$name} = $value;
 }
}

exit;

#---------####---------#


Thats it - sorry it is so long and badly written, any suggestions on any
aspect of them appreciated
Robin




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

Date: Mon, 14 Aug 2000 22:41:30 GMT
From: u2o@u2orange.co.uk (u2orange)
Subject: Re: chmod question
Message-Id: <3998753c.39257876@news.freeserve.net>

:)

Credits to you m8, nice one..!

Mat

On Mon, 14 Aug 2000 11:34:09 GMT, newsgroups@ckeith.clara.net (Colin
Keith) wrote:

>In article <3997ce53.9867883@news.btconnect.com>, mat@designsolution.co.uk (Mat) wrote:
>>Eye opener..!  You did forget to mention that you may need to convert
>>the mode (octal) to decimal, using the oct function.  Perl manual
>>p149.
>
>Ooh, mine doesn't have page numbers:) But it was omitted on purpose as these 
>examples in the perlfunc man page show:
>
>  $mode = '0644'; chmod $mode, 'foo';      # !!! sets mode to  --w----r-T
>  $mode = '0644'; chmod oct($mode), 'foo'; # this is better
>  $mode = 0644;   chmod $mode, 'foo';      # this is best
>
>The last one is assigning a numeric value to $mode where the value has a 
>leading 0. The leading 0 is taken by Perl to mean the number is octal. (see 
>the section "Scalar value constructors" in perldata).
>
>Since the OP had:
>  chmod(0777, .. );
>
>I decided not to comment. If they had 777 or '0777' then I would have :) 
>
>>This is not in anyway to get the last word, what you wrote encouraged
>>me to pay a bit more attention to the perl manual.
>
>Likewise, simply to explain why I decided not to comment on that.
>
>Col.
>
>
>---
>Colin Keith
>Systems Administrator
>Network Operations Team
>ClaraNET (UK) Ltd. NOC



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

Date: Mon, 14 Aug 2000 22:46:42 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: Convert URLs to links
Message-Id: <mF_l5.19514$f_5.90993@news1.rdc1.ct.home.com>

Keith Calvert Ivey <kcivey@cpcug.org> writes:

> And it won't do what people want with things like
> 
>     http://www.w3.org/Addressing/#time

Just curious, what do we 'want' to do with that one?

-- 
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)


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

Date: Mon, 14 Aug 2000 22:55:37 GMT
From: u2o@u2orange.co.uk (u2orange)
Subject: Re: currency format
Message-Id: <3998780f.39980919@news.freeserve.net>

On Mon, 14 Aug 2000 09:01:43 GMT, eastking@my-deja.com wrote:

>Hello ,every one here.
>
>I have a currency number in a scalar, such as
>
>my $a = 1234567;
>
>I want to it be showed as 1,234,567

$money = '1234567.00';
$money =~ s/\G(\d{1,3})(?=(?:\d\d\d)+(?:\.|$))/$1,/g;
print $money;	# 1,234,567.00

if you leave off the decimal place you will get 1,234,567

Hope this helps.

Mat.

>
>How can I do it.
>
>Thank in advance
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



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

Date: Mon, 14 Aug 2000 23:12:55 GMT
From: The burr <burra@colorado.edu>
Subject: Fork and Pipes
Message-Id: <8n9udk$o4o$1@nnrp1.deja.com>

One of you might be able to help me with this...

 I have a perl object which when initalized forks a child to ping a
subnet. This child must return the pingable machines to the parent
process as it gets them. The parent process then puts that info into an
array for storage until the main program needs the next ip. The main
program would get the next ip with this function call...
$pinging->next_ip(). Now can someone give me some example code or
something on how to get the ips from the child process to the parent
process without the use of nonstandard (not in main disro of PERL)
modules?? Do I use pipes? Can someone show me how to get this working??

please help me... sqeek.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 14 Aug 2000 14:20:41 +0800
From: "zhangkai" <zhangkai@bj.tom.com>
Subject: Help! How to connect two string to one. (Empty)
Message-Id: <8n835f$26tj$1@news.cz.js.cn>






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

Date: Mon, 14 Aug 2000 15:43:02 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Help! How to connect two string to one. (Empty)
Message-Id: <MPG.140215d2ef58714798ac78@nntp.hpl.hp.com>

In article <8n835f$26tj$1@news.cz.js.cn> on Mon, 14 Aug 2000 14:20:41 
+0800, zhangkai <zhangkai@bj.tom.com> says...

> Re: Help! How to connect two string to one. (Empty)

There are many ways.  You should read an introductory Perl book or 
tutorial.

Concatenation operator:  perldoc perlop

Interpolation into double-quoted string:  perldoc perlop

join() function:  perldoc -f join

 ...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 14 Aug 2000 22:50:38 +1000
From: "Kiel Stirling" <taboo@doofa.net>
Subject: Re: Help! How to connect two string to one. (Empty)
Message-Id: <3997eb1e$1_2@nexus.comcen.com.au>


"zhangkai" <zhangkai@bj.tom.com> wrote:
>>
>
my $string = "abcd"."efg";




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

Date: Tue, 15 Aug 2000 00:28:00 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: hows this?
Message-Id: <1efdqcq.10pmth4gno4clN%tony@svanstrom.com>

GI812 <mail@mail.com> wrote:

        <CUT]

No HTML... good, now if you only use a Subject-line that says what it's
all about then I might answer your question.

Ah, wazzup, doc? *goes away eating a carrot*


     /Tony
PS if you call it with "name.pl file" then you'll find "file" in @ARGV.
PPS I kinda deleted your reply before writing the PS, hope I remembered
the problem correctly.
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
 DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82  78A6 647F F247 9363 F1DB
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©1999  <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Tue, 15 Aug 2000 00:25:48 GMT
From: "Robert Brooks" <studentfl@hotmail.com>
Subject: Large Pieces of Code
Message-Id: <g60m5.44012$eS6.783649@news1.rdc1.md.home.com>

Question, I am writing a large program and I am trying to find a good way to
lessen the load on my server. The code is around 200kb. What is the best way
to break it down so it runs faster and doesn't take up as much space in
memory? I was thinking of doing the module approach... having different
modules, perl scripts themselves, and every time a user does a function it
is handled by a different module of the script. That is one way, but it
requires a little extra effort in sharing variables amoung the different
modules.

Are there any other ways? If I do "require" statements to require different
pieces of code, are those going to parsed before the program is run, thus
defeating the purpose of having different pieces of code in different files.

Besides optimizing the code so the script isn't so big (already done), are
there other ways to reduce the server's load? Thanks






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

Date: Tue, 15 Aug 2000 00:12:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: London =?iso-8859-1?Q?=A330-35K?= Perl Programmers Required
Message-Id: <Pine.GHP.4.21.0008150011230.16899-100000@hpplus03.cern.ch>

On Mon, 14 Aug 2000, Steven Merritt wrote:

> Damn straight. I don't care what the pic is of, I'd just like to see
> someone make a "live jpeg"

Just down the hall from the folks who sell "live recordings".




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

Date: 14 Aug 2000 18:25:14 -0500
From: tzz@iglou.com (Teodor Zlatanov)
Subject: Re: Mail with attachments
Message-Id: <399871ca_1@news.iglou.com>

<8n9esf$bqe$16$1@news.t-online.com>:Thomas (maibaum@bigfoot.com):comp.lang.perl.misc:Mon, 14 Aug 2000 20:50:39 +0200:quote:
: does anybody know, how I can send or receive mails with attachments in an
: easy way, for instance with a CPAN-Module?

If you mean MIME attachments, then yes, there are CPAN modules for that:

MIME-tools (the full-featured kit)
MIME::Lite (if you only need to create and send simple MIME messages)

The examples that come with the modules are very good, you should be OK with
them.

Ted


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

Date: Mon, 14 Aug 2000 22:04:49 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Re: Message board code
Message-Id: <8n9qdt$l6j$1@nnrp1.deja.com>

In article <8n8nm0$ort$1@nnrp1.deja.com>,
  gregosse2409@my-deja.com wrote:
> I will soon start to developp a message board (forum) in Perl.
> It will only use text files (no database).
> But I'm sure that some of you have already done such things...

> All URLs, sources and advices... are welcome !

My http://beam.to/iPerl/ contains a web guestbook example which stores
every message in a file of its own.  Due to the nature of iPerl you can
do the layout in plain HTML while doing the functionality in Perl in the
same file.

I'm thinking of drawing the functionality out into a library.  This
would handle variants of guestbooks and discussion forums, leaving the
HTML file to care mostly about presentation.  And it should abstract the
storage to let the user choose either single files, any of the DB
indexed file aproaches available for Perl or DBI access to any
database.  Care to help?

--
Bring text-docs to life!              Erwecke Textdokumente zum Leben!
                   http://beam.to/iPerl/
Vivigu tekstodokumentojn!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 14 Aug 2000 17:45:16 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Negativity in Newsgroup -- Solution
Message-Id: <8n9sps$42k$1@provolone.cs.utexas.edu>

In article <399843E9.FFB07EAF@home.com>,
Michael Carman  <mjcarman@home.com> wrote:
>Lou Moran wrote:
>> Actually the Knights Templar were expecting it and as such most
>> escaped it...
>> 
>> (one of the million useless things in my brain taking up the space
>> Perl could be using)
>
>undef %crusades;

Which is great, except that crusades tend to be implemented like this:

	package Crusade;

	sub DESTROY { my $x = new Crusade; }

 - Logan


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

Date: 14 Aug 2000 22:37:52 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Negativity in Newsgroup...Newbie Perspective
Message-Id: <8n9sc0$r5v$1@news.NERO.NET>

In article <7019-399838E6-49@storefull-245.iap.bryant.webtv.net>,
BUCK NAKED1 <dennis100@webtv.net> wrote:
>--WebTV-Mail-8626-2508

Yippee!

>NO EMAILS PLEASE.

Your request is my command.

>--WebTV-Mail-8626-2508

How about "No WEBTV emails"?

><body bgcolor="white" text="#000033">

Background still dark brown. Failure in HTML parser.

><embed src="http://lightning.prohosting.com/~discosco/mailcounter.pl">
><a href="http://downtowndisco.hypermart.net/index.html"><img



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

Date: Mon, 14 Aug 2000 16:01:29 -0700
From: sammytalin <sammytalinNOsaSPAM@usa.com.invalid>
Subject: Re: Perfect Place to find Perl Jobs
Message-Id: <20945db0.2e9ba6e5@usw-ex0107-055.remarq.com>

Don't listen to this guy... this newsgroup is all about Perl in
general.  This is useful information.

This guy is probably bitter cuz he can't find a job!

LOSER...


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Mon, 14 Aug 2000 23:55:21 GMT
From: "Ricky J. Sethi" <uscphysics@hotmail.com>
Subject: Re: Perlshop having probs with sendmail in Win98
Message-Id: <JF%l5.11022$IH.413926@newsread2.prod.itd.earthlink.net>


Jonathan Horniblow <jhorniblow@ntlworld.com> wrote in message
news:yoWl5.5067$pR4.99170@news6-win.server.ntlworld.com...
[SNIP]
>   print MAIL "To: $to\n";
>   print MAIL "From: $from\n";
>   print MAIL "Subject: $subject\n";
>   print MAIL "$body\n";
>   close MAIL;
[SNIP]
> ...Shipping and handling charges are not refundable. Error: Must specify
> message body or have at least one attachment. BCWare Sendmail/NT v1.1.4

Hi Jonathan,

I think you need to have 2 newlines after the subject to signal the end of
the headers; tagging on an extra \n (e.g., print MAIL "Subject:
$subject\n\n";) should do the trick.

Good luck,


Rick.






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

Date: 14 Aug 2000 23:26:42 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Print formatted output to variable
Message-Id: <8n9v7h$tan$1@towncrier.cc.monash.edu.au>

gbacon@HiWAAY.net (Greg Bacon) writes:

>In article <8n9ljf$8687m$1@ID-10728.news.cis.dfn.de>,
>    Oliver Bork <oliver.bork@comtrue.de> wrote:

>: how can I print the output delivered by a format to a variable ?

>The perlform manpage contains an example that does what you want.

You may also want to consider Text::Autoformat's form() subroutine.

Damian


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4015
**************************************


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