[8674] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2291 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 10 14:07:27 1998

Date: Fri, 10 Apr 98 11:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 10 Apr 1998     Volume: 8 Number: 2291

Today's topics:
    Re: Bill Gates should be invited to O'Reilly's "Free So <triche@tc.cornell.edu>
        Building perl/tk under win32 (Daniel)
    Re: Can someone give me an example of rounding! (brian d foy)
        can't copy gif file on NT? <yu.michael@epamail.epa.gov>
    Re: Clunky Perl Prose <rootbeer@teleport.com>
        Excessive (?) Memory Usage with Large Database (Tad Thurston)
        Expiring Images in CCI Scripts <jrives@vallnet.com>
    Re: Expiring Images in CCI Scripts (brian d foy)
    Re: General Rudeness, e.g. Re: Need a web login script <sowmaster@juicepigs.com>
    Re: General Rudeness, e.g. Re: Need a web login script (Tom Mornini)
    Re: General Rudeness, e.g. Re: Need a web login script (Stefaan A Eeckels)
    Re: General Rudeness, e.g. Re: Need a web login script (Michael J Gebis)
    Re: General Rudeness, e.g. Re: Need a web login script <flavell@mail.cern.ch>
        help for package problem <sfinnie@sqf.hp.com>
        HTTP server written in perl? <root@mail.mcoe.k12.ca.us>
    Re: keys in hashs (Mark-Jason Dominus)
        MacPerl standalone apps tchurch@gmu.edu
    Re: Multi-dimensional Array Access <rootbeer@teleport.com>
    Re: Multi-dimensional Array Access (Andre L.)
    Re: New error? I can't open a file to write! <jdf@pobox.com>
        Perl + UNIX login ()
    Re: Perl and procmail (I R A Aggie)
        Perl Puzzle: How Many Contexts? (Mark-Jason Dominus)
        print <kelby@mplx.com>
    Re: print <cmargoli@world.northgrum.com>
    Re: problem printing long line to file (Mark-Jason Dominus)
        Project involving Word <root@mail.mcoe.k12.ca.us>
    Re: RMS should be invited to O'Reilly's "Free Software  (Tim Smith)
    Re: s/PATTERN/<how to concat here>/g <Robert.Lopez@abq.sc.philips.com>
        sendmail substitute for Macperl <eslcafe@callisto.si.usherb.ca>
        strange behaviour of s/// interpolation <cnwetzel@linguistik.uni-erlangen.de>
    Re: Week of Month (Robert F. Harrison)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 10 Apr 1998 12:24:04 -0400
From: "Tim Triche, Jr." <triche@tc.cornell.edu>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <352E47A4.15FB@tc.cornell.edu>

Russell Nelson wrote:
> 
> Russ Allbery <rra@stanford.edu> writes:
> >
> > And furthermore, most of the documentation that comes with Perl was
> > written by the same people who wrote the books.  Imagine that.  [I]n
> > many cases, it's better and more complete.
> 
> And people still buy the books.  I have three Perl books in my office.

It's often quicker to look in Freidl's book than to peruse the manpages
or look at www.perl.com, for example.  And the perl manpages won't tell
me how to write a good regexp in Tcl.  There are pros and cons to both.

Whereas, the Java documentation on the Web is actually (IMO) better than
what you could buy for the basic classes and APIs.  JDBC and threads are
the only exceptions I have found, and that's because I'm a Java novice.

A well-written book (or even a poorly-written book that covers an
obscure or undocumented aspect of some valuable system) pays for itself.

-- 

    "...pi seconds is a nanocentury."

                            --Craig Berry


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

Date: 10 Apr 1998 16:12:34 GMT
From: daniel.mendyke@digital.com (Daniel)
Subject: Building perl/tk under win32
Message-Id: <6glgdi$q9f$2@nntpd.lkg.dec.com>


I'm trying to build perl/tk version 402.004 under NT 4.0 and I'm
not having a lot of success.  After manually editing two header
files I've now reached a point where dmake is asking for a 
file called 'tkImgPhoto.exc'.  Does anyone know what this file
is or how I can create it?

Any other suggestions on building on NT would be helpfull.  

-Daniel



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

Date: Fri, 10 Apr 1998 13:51:42 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Can someone give me an example of rounding!
Message-Id: <comdog-ya02408000R1004981351420001@news.panix.com>
Keywords: from just another new york perl hacker

In article <Pine.BSI.3.96.980410100551.16994A-100000@pentagon.io.com>, Chocolate <poohba@io.com> posted:

>I don't nor will I have access to the web for  about a week or two so I
>would really appreciate it if someone would tell me how to round to 2
>decimal point.  I don't know how much different it will be but I am not
>too familiar with perl5.

Tom Phoenix had a very nice article about the subject in the Winter 1997
issue of The Perl Journal [1].  Besides explaining the gotchas of
such a task, he demonstrated many ways to do it.

or you could just read about sprintf().

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Fri, 10 Apr 1998 13:39:07 -0400
From: "hsiwei yu" <yu.michael@epamail.epa.gov>
Subject: can't copy gif file on NT?
Message-Id: <6gllio$95i51@valley.rtpnc.epa.gov>

Hi All,

this script won't copy a gif file on NT (but OK on UNIX)

open( INFILE, "...gif" ) || die( .. );
open( OUTFILE, "> ...gif" ) || die( .. );

while ( <INFILE> ) {
   print OUTFILE;
}

The output gif file is smaller in size than the original. An implication of
this is I can't send a gif file to web page for display.

I run on NT, Perl from ActiveWare, version 5.003_07. Or I need a special
switch when copying binary file? TIA

Michael




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

Date: Fri, 10 Apr 1998 16:13:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Stillwell <mist@yoyo.cc.monash.edu.au>
Subject: Re: Clunky Perl Prose
Message-Id: <Pine.GSO.3.96.980410090314.9100w-100000@user2.teleport.com>

On 10 Apr 1998, Michael Stillwell wrote:

> If there's "more than one way to do it", what are the alternatives to
> these:
> 
>   1. Creating a reference to a list or hash returned by a function.

How about using the anon array constructor directly?

    $foo = [ split / /, $blah ];

>   2. Creating a copy of an object.  I do it with "$copy =
>      eval(Dumper($self))" with Deepcopy set to one, but there's got to
>      be a better way.

Give your objects a clone method, then use that. 

    my $copy = $self->clone;

>   3. Removing some elements from a list.  

Almost always, grep is the solution. If if bothers you to make a complex
grep, use a grep sub, instead.

    @list = grep &is_a_keeper($_), @list;

This should generally be better than using splice on @list - but the real
test is to try it both ways and see. 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 10 Apr 1998 17:07:00 GMT
From: thurston@balrog.nssl.noaa.gov (Tad Thurston)
Subject: Excessive (?) Memory Usage with Large Database
Message-Id: <6gljjk$22f$1@artemis.backbone.ou.edu>

Hello all,

I am reading a geographic (DEM) database of approximately 1.4 million points,
(1200x1200) where the points are three-digit numbers, and I noticed that the 
program is taking 69MB of memory to run.   This seems excessive, and
I am wondering if my code is horribly inefficient.  I can't think of
why it would use this much memory, but possibly one of you can help.

The main loop of the read routine is

for ($current_line = 1; $current_line <= $num_lines; $current_line++)
{
  chomp($current_line_check = (<DEM>));
  print "Error reading DEM file\n" if ($current_line_check !=
				       $current_line);
  chomp($num_elevations = (<DEM>));
  chomp($line_coord = (<DEM>));
  ($line_lon, $line_lat) = split(' ', $line_coord); 
  
  for ($j = 0; $j < $num_elevations; $j++)
  {
    chomp($temp = (<DEM>));
    push(@el, $temp); 
  }
}

I intend for all of the elevation points to live in the array @el, which
has 1.4 million elements.  The outer loop is executed 1200 times (1200
lines) and the inner one is executed 1200 times for each line.  In the
database, each point is a 3-digit integer followed by a newline.

If anyone has the time for suggestions, I would be thankful.

Thanks for your time,

Tad 
-- 
Tad R. Thurston	
thurston@nssl.noaa.gov


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

Date: 10 Apr 98 16:37:40 GMT
From: "JRives" <jrives@vallnet.com>
Subject: Expiring Images in CCI Scripts
Message-Id: <01bd649f$41441340$0cdf97ce@homer.vallfay.vallnet.com>

Does anyone know the correct way to expire an image when the server sends
it?  I have a SSI rotating picture script and want to expire the image when
the server sends it so that each time a sub page is visited and the visitor
goes back to the main page a different image is shown.


Thanks in Advance



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

Date: Fri, 10 Apr 1998 13:48:30 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Expiring Images in CCI Scripts
Message-Id: <comdog-ya02408000R1004981348300001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bd649f$41441340$0cdf97ce@homer.vallfay.vallnet.com>, "JRives" <jrives@vallnet.com> posted:

>Does anyone know the correct way to expire an image when the server sends
>it? 

all this is specified in the HTTP specs, available through the CGI
Meta FAQ.  HTTP is language independent, so it doesn't care if you
use Perl (hint - this is not a Perl thingy).

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Fri, 10 Apr 1998 12:04:15 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <352E42FF.1A14@juicepigs.com>

You're absolutely right Sonny. Abigail should have done the polite thing
and written the script for the idiot. 

sonny wrote:
> 
> Do you think that being rude to people who post questions that you deem
> aren't worthy will deter others from doing so?  All this invective just adds
> to the general noise.  Ignore them, tell them to RTFM, or give'm an URL, but
> this "its my playground" attitude is really childish.
> Abigail wrote:
> 
> > David Schwab (dschwab@wolfe.net) wrote on MDCLXXXII September MCMXCIII in
> > <URL: news:352C9571.FD3BAB78@wolfe.net>:
> > ++ Yes I need a weblogin script that allows people to pass a login and
> > ++ password thru a prompt and then have another way for an admin to add
> > ++ users and remove something like .Htaccess please help if you can.
> >
> > So, what's your Perl question?
> >
> > This group is not about the web, nor is it a gimme, gimme, gimme group.

-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Fri, 10 Apr 1998 16:08:27 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <tmorniniEr7Gu4.MvF@netcom.com>

sonny (sonny@88net.net) wrote:

: Do you think that being rude to people who post questions that you deem
: aren't worthy will deter others from doing so?  All this invective just adds
: to the general noise.  Ignore them, tell them to RTFM, or give'm an URL, but
: this "its my playground" attitude is really childish.

It does amaze me how some people, who understand everything technical,
understand so little socially.

In other words, I completely agree.

The "protectors of the group" need a crash course in leadership by example.

-- Tom Mornini
-- InfoMania


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

Date: 10 Apr 1998 16:44:35 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <6gli9j$jss$1@justus.ecc.lu>

In article <352E297E.D83CC086@88net.net>,
	sonny <sonny@88net.net> writes:
> Do you think that being rude to people who post questions that you deem
> aren't worthy will deter others from doing so?  All this invective just adds
> to the general noise.  Ignore them, tell them to RTFM, or give'm an URL, but
> this "its my playground" attitude is really childish.
So is this 'holier than thou' attitude, sonny boy.

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
  "Don't worry about people stealing your ideas.  If your ideas
   are any good, you'll have to ram them down people's throats."
                                                -- Howard Aiken


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

Date: 10 Apr 1998 16:56:41 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <6glj09$ggp@mozo.cc.purdue.edu>

tmornini@netcom.com (Tom Mornini) writes:
}sonny (sonny@88net.net) wrote:
}: Do you think that being rude to people who post questions that you deem
}: aren't worthy will deter others from doing so?  All this invective just adds
}: to the general noise.  Ignore them, tell them to RTFM, or give'm an URL, but
}: this "its my playground" attitude is really childish.

}It does amaze me how some people, who understand everything technical,
}understand so little socially.

}In other words, I completely agree.

}The "protectors of the group" need a crash course in leadership by example.

I couldn't help but notice that both of you also failed to answer the
question. 

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Fri, 10 Apr 1998 18:46:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <Pine.A41.3.95a.980410184554.146178D-100000@rsplus02.cern.ch>

On Fri, 10 Apr 1998, Tom Mornini wrote:

> The "protectors of the group" need a crash course in leadership by example.

Let's see yours.




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

Date: Fri, 10 Apr 1998 17:42:49 +0100
From: Scott Finnie <sfinnie@sqf.hp.com>
Subject: help for package problem
Message-Id: <352E4C09.D441FA8F@sqf.hp.com>

This is a multi-part message in MIME format.
--------------AA9C447F4A582D543098A0CA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I'm having a problem trying to invoke a subroutine inherited from an
ancestor class.

If I try to invoke the method in the normal way, I get an error:

  "Undefined subroutine &LinksetVerifier::isName called at
LinksetVerifier.pm line 31, <P> chunk 342."

If, however I call $object->can('isName') before invoking the function,
it works.  Any ideas, 'cos this has got me.  Please copy by email on any
responses since our news feed is intermittent.

Thanks,

Scott.

______________
environment: perl 5.003_07 binary distribution under win95.

Code details as follows:

(main.pl)
------------------------------------------
use LinksetVerifier;
 ...
 my $v = LinksetVerifier->new;
 $v->can('isOnOff');  ##### Doesn't work without these two lines...
 $v->can('isName');  #####
foreach $i ($linksets->contents) {
  $v->run($i);
 }
exit 0;
-----------------------------------------------
package LinksetVerifier;

use Verifier;
@ISA=qw(Verifier);

use PointCode;
use ScheduleMsg;

sub register {
 return("Linkset");
}

sub run {
 my ($this, $o)=@_;

 reportErr('invalId', $o->name) if (!isName($o->name));   # Line causes
problem
 foreach $i (($o->collection, $o->isup, $o->tcap)) {
  reportErr ('notOnOff', $i) if (!isOnOff($i));                      #
"       "     "      "
 }
 return 0;
}

1;
----------------------------------------------
package Verifier;

use ModelProcessor;
@ISA=qw(ModelProcessor);

sub register {
 0;
}

sub run {
 0;
}

sub isName {
 my $name=shift;
 if ($name =~ /\w+/) {
  return (1);
 }
 else {
  return (0);
 }
} # end isName

sub isOnOff {
 my $val=shift;
 if ($val =~ /^(on|off)$/ix) {
  return (1);
 }
 else {
  return (0);
 }
} # end isOnOff

1;
-----------------------------------------
package ModelProcessor;
require Exporter;

@ISA=qw(Exporter);

sub new {
    my $this = shift;
    my $class = ref($this) || $this;
    my $self = {};
    bless $self, $class;
    return $self;
}

sub register {
 0;
}

sub run {
 0;
}
1;

--
Scott Finnie   Tel. (+44) 131 331 7756
Telecoms Systems Division
Hewlett Packard Ltd.  mailto:sfinnie@sqf.hp.com


--------------AA9C447F4A582D543098A0CA
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Scott Finnie
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Scott Finnie
n:              ;Scott Finnie
email;internet: sfinnie@sqf.hp.com
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------AA9C447F4A582D543098A0CA--



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

Date: Fri, 10 Apr 1998 10:57:24 -0700
From: Mcoe NT <root@mail.mcoe.k12.ca.us>
Subject: HTTP server written in perl?
Message-Id: <352E5D84.5AEC61C4@mail.mcoe.k12.ca.us>

Hello group,

Has anyone seen a HTTP server written only in perl?

Thanks. joseph.



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

Date: 10 Apr 1998 10:50:10 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: keys in hashs
Message-Id: <6glbj2$1d5$1@monet.op.net>

In article <352DB35D.7243@outofservice.com>,
Jeff  <jn1@outofservice.com> wrote:
>$myhash{'key'} = 12;
>$myhash{key} = 12;
>
>first one is the better way to do it- the second one is a 
>bareword, and if perl6 ever came along and claimed the literal
>token key as a symbol, your script would fail.

Wrong.  They are identical.  Try 

	$myhash{time}

and see what it does.  Does it get the time?  Nope.


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

Date: Fri, 10 Apr 1998 12:15:07 -0600
From: tchurch@gmu.edu
Subject: MacPerl standalone apps
Message-Id: <6glk34$o6k$1@nnrp1.dejanews.com>

I have a script written in MacPerl.  If I save it as a standalone application,
I have to copy all of the libraries that it uses to a the location where the
application exists!  How can I get MacPerl to save all of the relevent
functions inside the standalone app?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Fri, 10 Apr 1998 16:01:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Jerome Bradenbaugh <jerome.bradenbaugh@firstunion.com>
Subject: Re: Multi-dimensional Array Access
Message-Id: <Pine.GSO.3.96.980410085552.9100v-100000@user2.teleport.com>

On Fri, 10 Apr 1998, Jerome Bradenbaugh wrote:

> @morestuff = ([1,2,3,4], [5,6,7,8], [9,10,11,12]);
> 
> Does anyone know the syntax for accessing the last element of each of
> the sub arrays (in this case, the 4, 8, or 12)?

I'm not sure what you mean by "accessing" in this case, but you can get a
list of those values like this:

   @rightmosts = map { $_->[-1] } @morestuff;

Note that the rows need not all be of the same length. 

You could work with just one of those values (the 8, for example) with
code like this:

    print "$morestuff[1][-1]\n";	# prints the 8.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 10 Apr 1998 12:17:11 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Multi-dimensional Array Access
Message-Id: <alecler-1004981217110001@dialup-525.hip.cam.org>

In article <352E1E31.70B7@firstunion.com>, Jerome Bradenbaugh
<jerome.bradenbaugh@firstunion.com> wrote:

> Dear Readers:
> 
> Accessing the last element of a single-dimension array is pretty
> straightforward:
> 
> @stuff = qw(monday tuesday wednesday thursday friday);
> 
> $stuff[$#stuff] represents the last element (friday in this case).
> 
> 
> However, consider the following multi-dimensioanl array:
> 
> @morestuff = ([1,2,3,4], [5,6,7,8], [9,10,11,12]);
> 
> Does anyone know the syntax for accessing the last element of each of
> the sub arrays (in this case, the 4, 8, or 12)?

=========

@morestuff = ([1,2,3,4], [5,6,7,8], [9,10,11,12]);

@lastElements = ();

foreach (@morestuff) {
  push (@lastElements, $_->[$#$_]);
}

# lastElements is (4,8,12)

HTH,

A.L.


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

Date: 10 Apr 1998 12:01:42 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: New error? I can't open a file to write!
Message-Id: <zphtlifd.fsf@mailhost.panix.com>

Tom Phoenix <rootbeer@teleport.com> writes:

[snip nice BEGIN block for CGI debugging]
> Now you should be able to see any error messages (and everything else)
> produced by your script, right on your browser.

or you could just

  use CGI::Carp qw( fatalsToBrowser );

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 10 Apr 1998 16:06:53 GMT
From: stephen@darwin.UCSC.EDU ()
Subject: Perl + UNIX login
Message-Id: <6glg2t$n8a@darkstar.ucsc.edu>

I have a rather 'dumb' question, but I have not been able to find out how
to pass 'username' and 'password' to my Solaris system so as to allow users
to execute several Perl scripts that I wish to install.

Any help greatly appreciated.

Stephen Hauskins

-- 


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

Date: Fri, 10 Apr 1998 12:25:36 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl and procmail
Message-Id: <fl_aggie-1004981225360001@aggie.coaps.fsu.edu>

In article <h67yaxdydmv.fsf@baynetworks.com>, plussier@baynetworks.com
(Paul L. Lussier) wrote:

+ Hi all.  I was wondering how to go about combining a perl mail filter
+ with a procmail recipe.

+ Does any one have any ideas on this?

Unless you have a huge investment in procmail, you may want to consider
using mailagent, which not only understands perlish regex's, but
also allows you to write extentions in perl.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 10 Apr 1998 11:06:45 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Perl Puzzle: How Many Contexts?
Message-Id: <6glci5$1ir$1@monet.op.net>

In article <352D97F3.F8D8C17A@coos.dartmouth.edu>,
Ronald J Kimball  <rjk@coos.dartmouth.edu> wrote:
>There is no such thing as an "array" context.  List, scalar, void.

I've been trying to make a list of contexts; not all are
distinguishable by `wantarray'.  The manual notwithstanding, there's
not really any such thing as `boolean' context; that's just a figure
of speech.  But there are at least two other contexts in Perl.



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

Date: Fri, 10 Apr 1998 11:46:26 -0400
From: "Kelby Valenti" <kelby@mplx.com>
Subject: print
Message-Id: <6gleut$afd@aaron.hamilton.edu>

How do you do the following?
I have a variable $One = "abc" , for example.

I want to:
print "$Oned";

This thinks that my var name is $Oned, I just want it to print the var and
then the letter.

If you could help i'd greatly appreciate it.
Thank you,
    Kelby





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

Date: Fri, 10 Apr 1998 16:37:08 GMT
From: Charles Margolin <cmargoli@world.northgrum.com>
Subject: Re: print
Message-Id: <352E4AB4.5D0A@world.northgrum.com>

Kelby Valenti wrote:
> 
> How do you do the following?
> I have a variable $One = "abc" , for example.
> 
> I want to:
> print "$Oned";
> 
> This thinks that my var name is $Oned, I just want it to print the var and
> then the letter.
> 

print "${One}d";

-- 
Charles G. Margolin                   DSSD Internal Information Services
cmargoli@world.northgrum.com          Northrop Grumman Corp. 0624/23
margolin@acm.org                      Hawthorne, California 90250-3277


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

Date: 10 Apr 1998 11:27:39 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: problem printing long line to file
Message-Id: <6gldpb$1o6$1@monet.op.net>

In article <1998041000574401.UAA20086@ladder01.news.aol.com>,
Hello570 <hello570@aol.com> wrote:
>        I tried printing a line to a file using both of the
> following methods, but the output was split into two 
>lines.

If you don't want newlines in the middle of your string, then don't
put newlines in the middle of your string.



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

Date: Fri, 10 Apr 1998 10:27:36 -0700
From: Mcoe NT <root@mail.mcoe.k12.ca.us>
Subject: Project involving Word
Message-Id: <352E5687.979438B0@mail.mcoe.k12.ca.us>

Hello group,

I have a project where i need to parse a scanned doc and insert the
whatever ( I say "whatever" because I am not sure what they are) to turn
this doc into a word template file as a word form. This way my client
can scan docs in, turn them into word forms, fill them in and print them
or whatever.  Does any one know of any modules that will allow me to
control word in this way.

Thanks. joseph.



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

Date: 10 Apr 1998 08:54:16 -0700
From: tzs@halcyon.com (Tim Smith)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6glfb8$chm$1@halcyon.com>

Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> wrote:
>People writing software they want to share with other people,
>and assure that their work will remain accessible, should
>use the GPL.

But if you want to share without strings attached, don't use GPL.
When I feel like giving something of mine as a gift to other programers,
I want it to really be like a gift.

Placing something in the public domain, or using a license with very
few restrictions, is like giving someone cash for their birthday.  They
get to decide exactly how they want to use it.  Placing something under
GPL is like giving someone a gift certificate for "Underwear R Us"
for their birthday.

--Tim Smith


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

Date: 10 Apr 1998 11:21:33 -0600
From: Robert Lopez <Robert.Lopez@abq.sc.philips.com>
Subject: Re: s/PATTERN/<how to concat here>/g
Message-Id: <jc6emz5384i.fsf@abqn07.ato.sca.philips.com>

mjd@op.net (Mark-Jason Dominus) writes:

> In article <6ghru1$frl$1@solaris.cc.vt.edu>,
> Michael Barnes  <mibarnes@mail.vth.vt.edu> wrote:
> >Use this instead:
> >
> >s/(STT,\d\d*\-\w\w*\-)(\d\d)/${1}19${2}/g;
> 
> That'll work great for....hmmm... about another 600 days or so.
> After that, bang.  01-Jan-1900.
> 
> Come on, folks.  When programmers in 1970 write COBOL programs that
> will break in the year 2000, it's not too hard to excuse their
> shortsightedness.  
> 
> It's the middle of 1998.   Who can excuse a failure to see ahead now?
> Is there a competition to see how short we can make our
> shortsightedness?   Will we still be doing this in Novermber 1999?
> 
	
I am converting data from old systems that must go into Y2Kapable
system. Just a short term project which will die when finished.
Thanks for the concern ;-)
-- 
Robert Lopez                    <Robert.Lopez@abq.sc.philips.com>



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

Date: Fri, 10 Apr 1998 16:13:51 GMT
From: John Taylor-Johnston <eslcafe@callisto.si.usherb.ca>
Subject: sendmail substitute for Macperl
Message-Id: <32F9FB6F.4455@callisto.si.usherb.ca>

Anyone know of another sendmail substitute for macperl.

I'm using this script - which works - but I don't receive a message! The
smpt address i use is correct!

#!perl

_______________________________________________________
print "Content-type: text/html\nPragma: no-cache\n\n";
	print "<HTML>\n";
	print "<BODY>\n";
	print "<P>WORKS!?\n";

$email = "eslcafe\@callisto.si.usherb.ca";
use Net::SMTP;

$smtp = Net::SMTP->new('callisto.si.usherb.ca');

$smtp->mail($ENV{USER});
$smtp->to('$email');

$smtp->data();
$smtp->datasend("To: $email\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();

$smtp->quit;

	print "<P>WORKS!?\n";
	print "</BODY>\n";
	print "</HTML>\n";


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

Date: Fri, 10 Apr 1998 18:10:43 +0200
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: strange behaviour of s/// interpolation
Message-Id: <352E4482.3D41@linguistik.uni-erlangen.de>

First of all: I know perlop, perlre and did carefully read
Jeffrey Friedl's book on regular expressions.

A guy in de.comp.lang.perl came up with this problem. First
I wanted to tell him about quoting, /e-modifier and such,
but trying the example showed me that my expectations about
how s/// is working were wrong.

Take this code snippet:

$_ = "I'm no real hacker perl.\n";
$search = '(hacker) (perl)';

and one of the following lines
$replace = '$2 $1';                 # case A, or
$replace = '$2." ".$1';             # case B

Now look at the result of the following replacement operations:

case      operation               result
-----------------------------------------------------------
A:   s/$search/$replace/;    I'm no real $2 $1
A:   s/$search/$replace/e;   I'm no real $2 $1
A:   s/$search/$replace/ee;  Scalar found where operator...

B:   s/$search/$replace/;    I'm no real $2." ".$1
B:   s/$search/$replace/e;   I'm no real $2." ".$1
B:   s/$search/$replace/ee;  I'm no real perl hacker.

1) Why is there no difference between zero /e's and one /e?
2) Why can't I force s/// to take $replace, interpolate it,
   yielding the same as s/$search/$2 $1/? (case A)

Perhaps someone could enlighten me about the way and order
s/// evaluates it's arguments...

Christian



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

Date: 10 Apr 98 13:27:14 GMT
From: harrison@pixi.com (Robert F. Harrison)
Subject: Re: Week of Month
Message-Id: <slrn6is7f0.stg.harrison@localhost.localdomain>

On 10 Apr 98 09:01:44 GMT, Robert F. Harrison <harrison@pixi.com> wrote:
> On Thu, 09 Apr 1998 I R A Aggie <fl_aggie@thepentagon.com> wrote:
> > 
> Having nothing better to do on a very wet and windy night I thought
> I'd take a crack at it. It's probably not portable as it uses
> Date::Manip (the UnixDate parts), does no error checking for things
> like (13/32/-0001) - but then neither does a pencil, is slow, not
> particularly clever, and so forth.  In addition, I paid no attention
> to which empire adopted what calendar in some other year of someone else's
> calendar.

Well, at least I found my own mistake. :-)  But I'm still working to
fix it.  It doesn't handle months that start right near the end of the
week really well.  [I've also moved on to Time:: and friends for the
speed].

-- 
rfh harrison@pixi.com


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2291
**************************************

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