[8320] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1937 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 20 00:12:52 1998

Date: Thu, 19 Feb 98 21:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 19 Feb 1998     Volume: 8 Number: 1937

Today's topics:
    Re: '.db' file extension automatic with dbmopen() ? (dk smith)
    Re: 5.004 bug? invisible object dereferencing (Jeremy Brinkley)
        any NT admin scripts to share (Ziplink)
    Re: Apache server not recognising perl scripts in cgi-b (Rahul Dhesi)
    Re: Avoiding $` uri@sysarch.com
        DBD::mSQL <kgraham@alpha.furman.edu>
    Re: Detecting Video Settings (Martien Verbruggen)
    Re: differences perl 4.0.1.8 -> 4.0.3.6 <zenin@best.com>
        executing perl scripts on NT (James Amihara)
    Re: Internationalization (Martin Vorlaender)
    Re: Is perl and DBI good enough? <zenin@best.com>
        Newbie + Databases <ismithr@info.curtin.edu.au>
        Newbie Question about Perl and Server Side Includes <PAnderson@AMCTheatres.com>
    Re: Newbie Question about Perl and Server Side Includes <justink@citizen.infi.net>
    Re: newby perl string processing Q <dformosa@st.nepean.uws.edu.au>
    Re: newby perl string processing Q uri@sysarch.com
    Re: perl -e in Win95? (Fernando Levin)
    Re: regexp question (Clive Newall)
    Re: Running SQL from within Perl (Martien Verbruggen)
    Re: Script will not connect to database when run by IIS (Martien Verbruggen)
    Re: Year 10000 Compliance (Ade Barkah)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Feb 1998 18:52:20 -0800
From: dks@mediaweb.com (dk smith)
Subject: Re: '.db' file extension automatic with dbmopen() ?
Message-Id: <dks-1902981852200001@tulini.mediaweb.com>

> dk smith (dks@mediaweb.com) wrote:
> 
> : In general, if Berkley DB is explicitly included with,
> 
> :    use DB_File;
> 
> : and then a subsequent call to dbmopen occurs like this,
> 
> :    dbmopen( %DB, "/etc/aliases", undef);
> 
> : isn't the ".db" extension appended to the filename? So
> : in this case the file name is actually:
> 
> :    /etc/aliases.db
> 
> Nope.
> 
> : Are there cases when this is not true? I'm running on Solaris 2.5.1, Perl
> : 5.004_03. Would gladly read yet another document if directed.
> 
> DB_File does not add any extension behind the scenes.
> 
> Paul

Thank you Paul for the response. I am porting code from a BSD system to
Solaris and believe that automatic '.db' extension feature is, indeed,
appended to filenames on the BSD box, but not on Solaris. 

-dk

-- 
DK Smith                                  MediaWeb, Inc.
dks@mediaweb.com                          Mountain View, CA, USA
======================================>>> http://www.mediaweb.com
Quality Web Hosting, Excellent Rates                 


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

Date: 20 Feb 1998 02:22:09 GMT
From: jeremy@wishbone.stanford.edu (Jeremy Brinkley)
Subject: Re: 5.004 bug? invisible object dereferencing
Message-Id: <6cipch$hq1$1@nntp.Stanford.EDU>

On 19 Feb 1998 10:55:13 -0500, Curtis Hrischuk (ceh@sce.carleton.ca) put forth:

> Help. I am running Perl version is V5.0 patchlevel 4 subversion 4,
> Solaris 2.5.1.  The problem is that references to objects are
> invisibly dereferenced (in successive lines) which is causing me all
> sorts of grief. 
> 
> The following code will help to understand the bug:
> ================================================================
>  . . . 
>  $self->thread_find_by_time( $aref ); # aref is from package AppTime.pm
>  . . . 
> 
>  sub thread_find_by_time
>  {
>    my $self = shift;
>    my($rap_time) = @_;
> 
>    print "type is ", ref( $rap_time ), "\n"; ##### type of reference
>    if ( ref ( $rap_time ) ) {
>      print "It is a reference\n";   ##### double check it is a reference
>    }
>    print "mytime is " . $rap_time->stringize() . "\n"; # error!! executes
>                                                        # without dereference

I apologize if I'm only showing my ignorance, but the syntax you're
showing should be correct, right?  stringize()'s first argument
is going to be a reference of type AppTime.

Perhaps I'm not clear on what you expected to see and how it differs
from what you do see.

> ================================================================
> It prints out:
> 
>  type is AppTime             ##### type of reference
>  It is a reference           ##### double check it is a reference
>  my_time [0.830217:   4: 97] ##### error, method called without
>                              ##### an explicit dereference

Are you saying you should get an error message instead?  Again, unless
I'm missing something (and that couldn't happen, right? ;>) what you
have described is correct and expected.  Of course I don't know what
the stringize() method does, but I'm assuming it turns some object
data into a string.

-- 
  Jeremy Brinkley                  jeremy@wishbone.stanford.edu
  System Administrator             finger for PGP key (2.6.2) or
  Stanford Blood Center            http://wishbone.stanford.edu/~jeremy


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

Date: Thu, 19 Feb 1998 22:50:16 -0500
From: "Fred Bickford (Ziplink)" <bickford@ziplink.net>
Subject: any NT admin scripts to share
Message-Id: <6ciuc8$1gg$1@bombay.ziplink.net>

Does anyone have any good NT admin scripts for sharing, Im try to
see if I can prove the usefulness of a couple of classes to management


Thanks

Fred




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

Date: 20 Feb 1998 03:47:05 GMT
From: c.c.eiftj@69.usenet.us.com (Rahul Dhesi)
Subject: Re: Apache server not recognising perl scripts in cgi-bin
Message-Id: <6ciubp$jav$1@samba.rahul.net>

In <34EB12A6.53A974FF@megsinet.net> Ricky <ric@megsinet.net> writes:

>that happened to me on my apache server, but my problem was me.  after
>looking over my script a thousand times, i FINALLY realized that i
>didn't have the little leading / before the usr. i had

>#!usr/local/bin/perl

Had you been using the CGI.pm module, you could have easily tested your
perl script from the command line.
-- 
Rahul Dhesi <dhesi@spams.r.us.com>


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

Date: 19 Feb 1998 23:05:13 -0500
From: uri@sysarch.com
Subject: Re: Avoiding $`
Message-Id: <x7yaz63oqu.fsf@sysarch.com>

Joe Gottman <joegottman@nospam.worldnet.att.net> writes:

>    As most Perl hackers know, using $`, $&, or $' anywhere in a program
> can result in an enormous performance hit.  It is easy enough to get the
> functionality of $& or $' by modifying the regular expression. If your
> basic regular expression is /a+/, you can emulate $& by using /(a+)/ ,
> and you can emulate $' by using /a+(?=(.*))/ (using positive lookahead
> and saving the result, this is legal according to 'Mastering Regular
> Expressions').  What is the best way of emulating $` ?

why not just use

/^(.+?)(a+)(.+?)$/

$1 eq $`
$2 eq $&
$3 eq $'

i have never used $`, $& or $'. when i want the parts i just match
for them in ().

in my book $`, $& and $' are deprecated by virtue of the efficiency hit
and lack of explicit matching.

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Thu, 19 Feb 1998 23:11:28 -0500
From: kevin graham <kgraham@alpha.furman.edu>
To: dbi-users@fugue.com
Subject: DBD::mSQL
Message-Id: <34ED0270.4E9F23E6@alpha.furman.edu>

Alright. I've dug through FAQs, examples, and documentation, so if I've
missed something, I extend my deepest appologies..

My setup is:
OSF/1 4, perl 5.004_04, DBI 0.93, and DBD::mSQL 1.1814.. I'll post the
troublesome segment from the script, as its otherwise 400+ lines..

$DB_DSN = "DBI:mSQL:auction:alpha.furman.edu";
$DB_user = "";
$DB_passwd = "";

$dbh = DBI->connect($DB_DSN, $DB_user, $DB_passwd, {AutoCommit=>1}) ||
die DBI->errstr;

sub this_doesnt_work {
  my $SQL = "SELECT email,pin FROM bidders WHERE email = '" .
$cgidata->param('new_email') . "' OR pin = " .
$cgidata->param('new_pin');
  my $h_idexists = $dbh->prepare($SQL) || die $dbh->errstr;

  print "hope";
  $h_idexists->execute($SQL) || print "dammit"; #die $dbh->error
  print "thanks;
}

The problem here baffles me. The script runs fine until it gets to the
DBI execute(). At this point the sub is exited, control returns to main,
and it exits normally. (note that while "hope" is displayed, neither
"dammit" nor "thanks" are displayed).

This is a CGI, though the results are identical offline as well. If
anyone has a clue as to where I should start to fix this, it'd be
genuinely appreciated. The deadlines are pressing, so I'm equally open
to alternatives as well..

thanks.
 ..kg..
kgraham@alpha.furman.edu
kevin graham


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

Date: 20 Feb 1998 02:02:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Detecting Video Settings
Message-Id: <6cio84$sjf$1@comdyn.comdyn.com.au>

In article <#GHIJFZP9GA.381@upnetnews02.moswest.msn.net>,
	"Jay Phillips" <jphillips1@email.msn.com> writes:
> Does anyone know a way to extract the video settings from the internet user
> so to customize the page format for different types of displays ?

Ask them to upload their registry. Read it. Extract the information
from it. Of course, it won't work if the connecting person doesn't
have a PoB program loader.

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Advertising:  The science of arresting
Commercial Dynamics Pty. Ltd.       | the human intelligence long enough to
NSW, Australia                      | get money from it.


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

Date: 20 Feb 1998 02:55:19 GMT
From: Zenin <zenin@best.com>
Subject: Re: differences perl 4.0.1.8 -> 4.0.3.6
Message-Id: <887943566.507488@thrush.omix.com>

Haig <rhaig@austin.ibm.com> wrote:
: some internal customers are using 4.0.1.8 & I'm trying to come up with 
: reasons for them to upgrade to at least 4.0.3.6. (the most recent
: unsupported version)

	Perl 4 (even 4.0.3.6) is not y2k compliant.  Upgrade them to
	5.00404. :-)

: Also, I'd be interested in what would have to be done to any arbitrary
: perl4.0.1.8 script to make it run on perl5.  

	If there is anything, it's putting backslashes infront of
	@ symbols within double quoted strings, eg for email addresses
	and such:
		print "foo@bar.com";
	to
		print "foo\@bar.com";
	This is a no brainer however, as a quick perl -wv script will
	show you a vary clear message about the fact and give you the
	exact line numbers.

: I didn't come into the world of perl until perl5, so I don't have any 
: first hand experience with perl4isms.

	Perl4 is a world of kluges.  Most "advanced" features you find
	with perl5 must be done as kluges in perl 4 to even do simple
	things like 2d arrays.  Be afraid, be vary afraid.
-- 
-Zenin
 zenin@best.com


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

Date: 20 Feb 1998 04:16:52 GMT
From: amihara@Hawaii.Edu (James Amihara)
Subject: executing perl scripts on NT
Message-Id: <6cj03k$223@news.Hawaii.Edu>

	this is really a newbie question about running
	perl scripts on my NT but how do you do server
	side includes?

	i know on unix, all i have to do in my html file
	is to have a statement like:
	<!--#exec cgi="/cgi-bin/perl.pl"-->

	and it will execute the perl program perl.pl... how
	do i do it for NT? i am running IIS 3.0...

	thanks...

--


       ________
      /__   __/
        /  /___   ==========================================================
 ___   /  ___  \   James Amihara                      Phone: (808) 453-6565
/  /__/  /__/  /  University of Hawai'i - West O'ahu    Fax: (808) 453-6075
\____    __   /  96-043 Ala Ike                          amihara@hawaii.edu
    /  /  /  /  Pearl City, Hi 96782      http://www.uhwo.hawaii.edu/~james
   /__/  /__/  =============================================================



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

Date: Thu, 19 Feb 1998 19:07:46 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Internationalization
Message-Id: <34ec74f2.524144494f47414741@radiogaga.harz.de>

soul@explorer.com wrote:
: any simpler ideas out there?

Well, perhaps not simpler, but a more consistent way of doing it:
using classes. Search at DejaNews for a thread with the subject
"Writing Multilingual Software". IIRC, it was 2 weeks ago. There,
philippe.verdret@eurolang.fr posted his Babel module, which is a
rather nice solution.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 20 Feb 1998 02:40:58 GMT
From: Zenin <zenin@best.com>
Subject: Re: Is perl and DBI good enough?
Message-Id: <887942705.427775@thrush.omix.com>

Jonas Liljegren <jonas@paranormal.o.se> wrote:
: We had a meeting today about this. Maby I was bad at presenting perl,
: but they choosed servlets. I lost. :-(

	Sorry to hear that, but not surprised.  Dilbert has managers pegged
	perfectly.  They rarely, if ever have even an ounce of clue and
	should never be allowed to make any technical choices.  They almost
	always base major company direction on whatever is being hyped the
	most at the time.

	I work with DBI and a number of Java database interfaces
	daily.  Although Java is being pushed vary hard to get up
	to speed, at this point it is still far behind Perl and will
	be for some time.

	The biggest issue I have ever had with DBI is installing the
	drivers for some databases. -The Oracle and MiniSQL drivers
	install pretty cleanly now, but the Informix drivers are still
	a nightmare and the braindead config for it just trys to make
	it harder.  However, once any of the drivers install I have
	absolutely no problem with them.

: The goal is to have a development tool there you realy fast can put
: together different components. The components shold work together
: without side effects. New programmers have to be able to quickly
: understand a single component to make modifications.

	Hmm, sounds like Perl to me. :-)

: 1. Java forces you to make structured programs. You don't have to invent
: a programming structure. The controls ar built in to the language.

	This I've always found only useful as a crutch for new and/or simply
	bad programmers.  Funny thing is, no matter how "structured" one
	trys to force a language to be, they *always* manage to find
	ways to create write-only code.  I've worked with Java apps in
	the 100k line range with absolutely no way to reuse any of it
	without cut and paste, and even then you would be better off
	rewriting it because it's so bad...

	Good programmers write good code.  Bad programmers write bad
	code.  There is *NO* way to make a bad programmer write good
	code.  No language with *ever* change that.  Python tried,
	and failed, and it's more "structured" then Java.

: 2. Java has many development tools.

	Ditto for Perl (and pretty much any other programming language).

: Drag'n drop programming interfaces.

	And this is a Good Thing...?  For building GUIs it's not bad,
	but not for much else. -And I think perl has a Tk GUI builder
	somewere.

: Meta-tools for object-oriented programming,

	Yhon...

: documentation,

	pod

: version control

	RCS

: etc. The graphical interface makes it somwhat easier to use without
: having to learn the details about it.

	See comments above about bad programmers only being able to
	write bad code no matter what pretty GUI interfaces you have
	them use.

: 3. I don't get it, but they din't seem to be impressed of CPAN, the perl
: community or the Perl Clinic. Like: "We can't depond on the free support
: fromhighschool students that wrote cool perl modules. We will get in the 
: situation there we can't get help just becuse the programmer student has
: a paper to do."

	This, is why everything is shipped in source form.  Managers *love*
	support contracts, but I rarely find them anywere close to as
	useful as source.  Managers like them because managers hate
	taking responsibility.  They like to pass the buck:  "Mr Smith,
	we have tracked the bug down to a problem Oracle's new JDBC
	driver.  But it's ok, we have a trouble ticket into them and
	will let you know when it's fixed.".  This meens the manager
	can truthfully sit back and say, "Sorry, until [insert your
	supplier here] fixes x, y, and x there is nothing my group
	can do.  It's not our fault.".  No one can get upset with
	them for not fixing the problem fast enough because it's not
	there problem per-sey.

: And the rule out the Perl Clinic because it doesn't sound
: serious enough. Six-packs and "money back" is not the type of support we
: seeks. We want dedicated professional programmers, tied with support
: contracts on a per year basis. The Perl clinic seems more like a hacker
: support for isolated fixes.

	Hmm, can't comment here as I haven't used them. -When one of
	my fellow programmers finds a bug in perl or a module here,
	they normally come to me and I find/fix it, so at this point
	we don't need a Perl support contract. :-)  I do understand
	that this is not always (or even oftin) the case for others.

: We can't use modules at CPAN just like that. What kind of quality
: control has they gone through?

	I love when this one comes up.  No, they are right.  Vary,
	vary few perl modules have ever gone though any "formal"
	QC.  This is the case with most free software.

	I more oftin then not find however, that free software (with
	free source) is *much* more reliable then commercial software.
	Why?  Because the people that are writing are doing so because
	they want to, not because they got stuck on the project.
	Because the source is available, so anyone that finds a bug
	can also find a fix and submit it back to the authors thus
	speeding up the process.  The entire freeware cycle is a
	far better QC system then will ever be found in pure
	commercial software.

: Many of the DBD modules seems to be in alpha or beta stage.

	In name only, not quality.  As the readme for the DBI module
	states, it was only in beta because the interface was not
	set in stone.  It is now, as 1.0 was just released, however
	it has been rock solid for a vary long time now.

: 4. The future. Is it better to take every chanse to build competence
: in java?

	They are both tools.  They both do different jobs better or
	worse then the other.  Java makes nice client GUI applications.
	Perl (and C) make *much* better server side servlets and servers.

: There seems to be more java programmers availibel than perl
: programmers. At least in my company.

	If this is the case for your company, then going Java might
	be a better answer for you.

	I highly doubt however, that you will find more good Java
	programmers then good Perl programmers. -You will however, find
	lots of bad Java programmers that are jumpping onboard the hype
	and not much else (old VB and C++/MFC people mostly (blgh)).

: The answers on this list tells me that there has been big projects with
: perl dbi. But is this the normal case?

	Yes, but again it depends on the application.  I actually
	prefer Java for the client side (delivered via Merimba or
	similar "tuner" system).

: Maby most projects has been developed in C++ or other languages?

	It depends.  I would vary rarely, if ever recommend C++ to
	be used for server code, but like everything else it depends
	on exactly what you are trying to do.  That said, Perl and
	C are what I recommend mostly.

: I would realy like a remedy for the points above. All you who has
: developed big programs: how do you structure the components to eliminate
: mistakes and enable fast development?

	By componets (at least in Perl), do you meen modules?
	This can not be answered in a single message.  This is an
	issue that will change from project to project depending on
	what the design team (or person) desides is the best way.
	There basic guidelines, but they are no different they one
	would find in any number of textbooks.

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 18 Feb 1998 13:58:00 +0800
From: Ray Smith <ismithr@info.curtin.edu.au>
Subject: Newbie + Databases
Message-Id: <34EA7868.41C6@info.curtin.edu.au>

Hi all,

I'm just starting out so please excuse my incompetance.

I'm trying to write a Perl script (eventually to be used as a CGI) that
will store about 30 values into a database file/table per key/record.  I
have currently got the DB_File package and it seems that I can only
store one value per key.  Does anyone know how to get around this,
and/or any examples that actually do this.  I need to be able to search
through the file - which will become quite large as time goes by - and
do some processing on the individual values.

TIA, Ray.
--
Ray Smith
Curtin University of Technology
Selby St Shenton Park 6008 Aust.
Ph: 	+61 8 9266 3667
Fax: 	+61 8 9266 3636
Email: 	ray@guardian.curtin.edu.au
--


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

Date: 20 Feb 1998 03:37:29 GMT
From: "Phil Anderson" <PAnderson@AMCTheatres.com>
Subject: Newbie Question about Perl and Server Side Includes
Message-Id: <01bd3db0$e17f59c0$ee02e0a9@itpla>

I am new to programming PERL and am having problems getting a Server Side
Include to function correctly.

My PERL script generates all the HTML and sends it to the browser, but the
server doesn't seem to recognize the <!--#include file="x.html"--> tag.  By
that I mean it doesn't do the include, I see the tag as a comment in the
HTML source.

I'm running PersonalWebServer Win95 with PERL version 5.003_07.

Thanks in advance
--------------------
Phil Anderson
AMC Theatres
EMail: PAnderson@AMCTheatres.com









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

Date: Thu, 19 Feb 1998 23:12:07 -0500
From: "Justin" <justink@citizen.infi.net>
Subject: Re: Newbie Question about Perl and Server Side Includes
Message-Id: <6civul$hs7$1@nw001t.infi.net>


Phil Anderson wrote in message <01bd3db0$e17f59c0$ee02e0a9@itpla>...
>I am new to programming PERL and am having problems getting a Server Side
>Include to function correctly.
>
>My PERL script generates all the HTML and sends it to the browser, but the
>server doesn't seem to recognize the <!--#include file="x.html"--> tag.  By
>that I mean it doesn't do the include, I see the tag as a comment in the
>HTML source.
>
>I'm running PersonalWebServer Win95 with PERL version 5.003_07.


That is because the server doesn't parse the output of the script. for
including the HTML file like that just do:

open(FILE, "<filename");
print <FILE>;
close (FILE);





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

Date: 20 Feb 1998 02:09:42 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: newby perl string processing Q
Message-Id: <887940582.95776@cabal>

In <6cg8ml$2lt$1@news.latrobe.edu.au> boc@thistle.bendigo.latrobe.edu.au (Brian O'Connor) writes:

[...]

>A password file, I want the 4th field(grp id)
[...]
>($a,$b,$c,$d,$e,$f,$g) = split(/:/);

>then use $d, but there must be a better way

$grp_id=(split(/:/))[4];

Should do it.


--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 19 Feb 1998 23:43:46 -0500
From: uri@sysarch.com
Subject: Re: newby perl string processing Q
Message-Id: <x7vhua3myl.fsf@sysarch.com>

? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> writes:

> In <6cg8ml$2lt$1@news.latrobe.edu.au> boc@thistle.bendigo.latrobe.edu.au (Brian O'Connor) writes:
> 
> >A password file, I want the 4th field(grp id)
> [...]
> >($a,$b,$c,$d,$e,$f,$g) = split(/:/);
> 
> >then use $d, but there must be a better way
> 
> $grp_id=(split(/:/))[4];
> 
> Should do it.


even better (assuming you have a username)

$grp_id = (getpwnam($name))[3];

note that grp_id is the 4th field but perl arrays start with 0

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Tue, 17 Feb 1998 00:25:30 GMT
From: fernando.levin@iol.it (Fernando Levin)
Subject: Re: perl -e in Win95?
Message-Id: <34e9d88a.10889976@news.iol.it>

On 13 Feb 1998 04:07:25 GMT, lethr@dont.spam.the.net (lethr) wrote:

>Does anyone know if the perl -e (not working) is being addressed/resolved?
>Is there an alternate?  Here's what I get:
>
>C:\perl.scripts>perl -e 'print "Hello\n;"'
>Can't find string terminator "'" anywhere before EOF at -e line 1.
>
Try:
perl -e "print qq(Hello\n);"
>
>I was pretty bummed when I found -e not working.
>Thanks!
You're welcome.

Fernando,
fernando.levin@iol.it

Fernando Levin
fernando.levin@iol.it


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

Date: 20 Feb 1998 14:08:01 +1100
From: crn@nellie.bby.com.au (Clive Newall)
Subject: Re: regexp question
Message-Id: <v5k9arx9bi.fsf@nellie.bby.com.au>

[posted & mailed to original poster]

The code is playing with the G(E)COS field from a Unix passowrd file, yes?
(I don't have Camel I handy).

The string "&" in this field is replaced with the Unix username on output
by such things as "finger". (Usually with an initial cap.)
So this code is (I assume, you didn't show us) attempting to emulate
this behaviour.

eg:iserver:x:23:200:& Owner:/:/bin/sh
finger iserver
Login name: iserver                     In real life: Iserver Owner

The comment is probably because this use is (and probably always was)
not particularly useful, and often more trouble than it was worth.

ie: It's a hack, to overcome an unusual, but alas not rare, coding 
    convention. 

And as Russ points out: & is just a '&', nothing special to Perl.

crn 

In article <m3vhubgidh.fsf@windlord.Stanford.EDU> 
	Russ Allbery <rra@stanford.edu> writes:

   Rasta Kyle <rasta@spacestar.com> writes:

   > $fullname =~ s/^[^,]*-(.*)\(.*/$1/ || $fullname =~ s/'.*//;

   > if ($fullname =~ /&/) {      #you don't want to know

   > My first question is why would you put a comment like "you don't want to
   > know" in a book teaching someone the laguage?"

   No, probably not, without at least explaining it in a footnote.  I imagine
   the reason is humorous, though.  (I'm not sure what it is, beyond the fact
   that & is a shell metacharacter.)

   > Second question is .....I understand the first line but what is the & in
   > this expression? Is it litterally an "&" or does it represent a variable
   > I cannot find in the camel book or the O'Reilly book on Regular
   > Expressions?

   Literally a &.

   -- 
   #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
   $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
    00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
   rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
-- 
Clive Newall <crn@bby.com.au> / Broker Services Australia Ltd Melb Australia
"I think Casper is the ghost of Richie Rich. I wonder how Richie died?"
"Perhaps he realized how hollow the pursuit of money is and took his own life"
  --Bart and Lisa Simpson


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

Date: 20 Feb 1998 03:22:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Running SQL from within Perl
Message-Id: <6cissr$t25$1@comdyn.comdyn.com.au>

In article <6cil8s$42o@camel12.mindspring.com>,
	"Kevin Bass" <akil1@mindspring.com> writes:
> How can I run a SQL program or script from within Perl?  

use DBI;

http://www.hermetica.com/technologia/DBI/

> Please supply syntax and/or an example.

Nope. Examples in the doc.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: 20 Feb 1998 03:27:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Script will not connect to database when run by IIS
Message-Id: <6cit6j$t25$2@comdyn.comdyn.com.au>

In article <34ecc61b.2672750@news.crosslink.net>,
	sgregory@crosslink.net (Scott D. Gregory) writes:

> As I said before, this script works great when I run it from the
> command line and feed it the parameters to decide what page to create.
> The script does work great when run from IIS if it does not have to
> access the database.  And, I know IIS is passing the script the proper
> parameters since it is trying to access the database.

Sounds like you're having that classical CGI problem: My script runs
when I run it from the command line,. but not as a CGI.

perldoc perlfaq9
(first question)
/My CGI script runs from the command line but not the
     browser.  Can you help me fix it?

If you have read the documentation referred to in that answer, and
still cannot figure out what goes wrong, please come back, and ask
again.

Oh, since you're on Win32, also read:

http://www.perl.com/CPAN/doc/FAQs/win32/Perl_for_Win32_FAQ.html

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: 20 Feb 1998 03:39:27 GMT
From: mbarkah@hemi.com (Ade Barkah)
Subject: Re: Year 10000 Compliance
Message-Id: <6cittf$h3c@news.hemi.com>

Colin Dooley (colin@medit3d.com) wrote:
: I'm looking forward to the year 10000 problem with interest.

Most computers today wont be able to work past the year 2038
(time_t overflows,) so lets fix that first. ;-)

-Ade
--------------------------------------------------------------------
Inet: mbarkah@hemi.com - HEMISPHERE ONLINE - www: <http://hemi.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 1937
**************************************

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