[13942] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1352 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 11 18:10:37 1999

Date: Thu, 11 Nov 1999 15:10:23 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942361823-v9-i1352@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 11 Nov 1999     Volume: 9 Number: 1352

Today's topics:
    Re: new line break??? <andrew.fase@stud.umist.ac.uk>
    Re: Online OO Perl tutorial? <seshadri@ptc.com>
    Re: OO question again <schmickl@magnet.at>
        output a binary file to browser from perl script abnerstransky@my-deja.com
        Outputting to a printer from Perl? (Win32) <joneill@pgicompanies.com>
    Re: Parse delimited file with \n's. <jeff@vpservices.com>
    Re: Parse delimited file with \n's. <gkl200@my-deja.com>
    Re: Parse delimited file with \n's. <skilchen@swissonline.ch>
    Re: Passing arrays + other arguments to a subroutine <aqumsieh@matrox.com>
    Re: Passing arrays + other arguments to a subroutine irf@netexecutive.com
    Re: Perl Extensions. Arrgh. (Ilya Zakharevich)
    Re: Perl Interpreter in Java <seshadri@ptc.com>
    Re: Problem: MySQL, variable scope, references salvadorej@my-deja.com
        Problems using $^O and $Config{'archname'} <whian03@bellsouth.net>
    Re: Q: Instructions for embedding Perl in Borland Delph <jon@midnightbeach.com>
    Re: Q: Instructions for embedding Perl in Borland Delph <theglauber@my-deja.com>
    Re: Removing leading zeros from a string? <gellyfish@gellyfish.com>
        Senior Software Engineer (Perl)-Positions Available <david@hotjobs2000.com>
    Re: Senior Software Engineer (Perl)-Positions Available <emschwar@rmi.net>
        Some more questions on modules' usage (Eric Dew)
        sorting withing multiple files (Steve .)
    Re: sorting withing multiple files <mj.stevenson@auckland.ac.nz>
    Re: sorting withing multiple files <lr@hpl.hp.com>
        supress '$' symbol rancorr@hotmail.com
    Re: supress '$' symbol raju_k@iname.com
    Re: supress '$' symbol (Eric Dew)
    Re: supress '$' symbol <seshadri@ptc.com>
    Re: use overload -- "0+" takes the place of "bool" (Ilya Zakharevich)
    Re: Virus <aqumsieh@matrox.com>
    Re: Virus (Martien Verbruggen)
    Re: Virus <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 11 Nov 1999 19:22:42 +0000
From: FASE Andrew <andrew.fase@stud.umist.ac.uk>
Subject: Re: new line break???
Message-Id: <382B1782.468A1F53@stud.umist.ac.uk>

YoungJoon Yoon wrote:

> I just hava a simple and stupid question.
> When I save a text file in Windows and open it from Unix box, I see "^M" in
> the end of each line. So, would you tell me why this happens and how to get
> rid of this by coding perl? I am sure there might be very simple way to do
> it, but don't know how. I tried to do it by regular exp., but it doen't
> work.
>
> - Thanks

Its just that windows uses a newline character and a charrage return and unix
only uses a newline character

So in unix you will see these annoying carrage returns at the end of each
line.

Very simple to get rid of , in fact i think there a program call wintounix of
something that does it for you...but in perl just do s substitution with \r
and nothing

i.e s/\r//g;

Andy



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

Date: Thu, 11 Nov 1999 13:57:37 -0500
From: Seshadri <seshadri@ptc.com>
Subject: Re: Online OO Perl tutorial?
Message-Id: <382B11A1.A5EFD0FC@ptc.com>

Check perltoot on perl.com. Best so far...

- Sesh


Brian Simpson wrote:

> I'm looking for a online crash course in object-oriented Perl
> on the Internet.  Does anyone know of any good sites?
>
> Brian Simpson
> bsimpson -at- fc -dot- hp -dot- com



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

Date: Thu, 11 Nov 1999 23:08:28 +0100
From: Thomas Schmickl <schmickl@magnet.at>
Subject: Re: OO question again
Message-Id: <382B3E5C.CFBCFE61@magnet.at>

James Tolley schrieb:

> If you think you'll be adding features to your
> code in the future such that you'll want to change
> the way these variables are stored, it's a good
> idea to encapsulate them behind get/set methods.
> If you think the module will remain essentially
> the same forever, then by all means, stay with the
> direct access method.

I have learned in between that you can call a sub in different contexts, f. ex. the scalar and the array context.

In my case it would be the most easy thing to call a subroutine in an array-  or an reference-of-an-array context, which will work I think.

But how could I do an scalar-context together with an reference-of-a-scalar context, which are basicsally both scalars. Is this possible.

The second thing is, if Tk takes an reference to an hash-value to read/write from/to it, is there a way that it uses the reference of an Get/Set-subroutine the same way ? I think not, but maybe there is one ?

Ciao, thomas


----------------------------------------------------
Thomas Schmickl,
Department for zoology
Karl Franzens University Graz, Austria.
----------------------------------------------------
Visit the GPL e:doc-project on http://members.magnet.at/hfbuch/edoc
or mail me at schmickl@magnet.at
----------------------------------------------------




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

Date: Thu, 11 Nov 1999 22:37:19 GMT
From: abnerstransky@my-deja.com
Subject: output a binary file to browser from perl script
Message-Id: <80fgeu$hjd$1@nnrp1.deja.com>

Hello
I'm trying to write a script that will send a gzip'd file to the
browser via http only when the user has entered a password correctly. I
don't want a simple Location:http://etcetc tag, because I don't want
the URL to be accessible. So how do I output a 2meg gzip file - that
is, read it from the directory and spit it out to the browser?
Thanks very much
Abner


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


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

Date: Thu, 11 Nov 1999 20:52:01 GMT
From: "joneill" <joneill@pgicompanies.com>
Subject: Outputting to a printer from Perl? (Win32)
Message-Id: <R%FW3.7704$L5.88689@c01read02-admin.service.talkway.com>

I consider myself to be an advanced novice, and Perl has done many
wonderful tasks for me in the past year. One of the things I've never
figured out is how to output to a printer from a perl program -- even
in line mode.

Question:
1) Is there a simple way to redirect output to a printer device?
* if so -- is there a module/package that will allow me to transcend
the line mode of printing? (able to use TrueType fonts, all points
addressable, etc.)
* if no -- what is the usual method for people to print documents from
Perl?

T.I.A.

Jay O'Neill
PGI Companies
jo'neill@pgicompanies

p.s. I'm getting to the skill level where I might be able to answer
some of the easier questions posted(I feel like I should; so many
people have helped me along the Perl Way). Are there any guidelines I
need to follow? (I think I've heard the term Usenet [guidelines])
--
Free audio & video emails, greeting cards and forums
Talkway - http://www.talkway.com - Talk more ways (sm)



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

Date: 11 Nov 1999 18:35:27 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Parse delimited file with \n's.
Message-Id: <382B0C28.CA33F756@vpservices.com>

gkl200 wrote:
> 
> Hi, is there a Perl function or an easy way to parse the following line
> of data below into three fields? I want to take exported tab delimited
> text data from MSAccess and import into MySQL.
> 
> data:
> "AAA"\t"BBB"\t"CCC\nDDD\nEEE\nFFF"\n
> 
> becomes:
> $field1 = "AAA"
> $field2 = "BBB"
> $field3 = "CCC\nDDD\nEEE\nFFF"

If you export the access files as CSV (Comma Separated Values) instead,
DBD::CSV will do what you want right out of the box.  Or you could
export as tab delimited and change the delimit character in DBD::CSV. 
Or even simpler, use DBD::ODBC to read the data directly from Access
with no exporting at all, and use DBD::mysql to insert each record into
MySQL as you read it.

-- 
Jeff


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

Date: Thu, 11 Nov 1999 20:21:35 GMT
From: gkl200 <gkl200@my-deja.com>
Subject: Re: Parse delimited file with \n's.
Message-Id: <80f8g9$bf4$1@nnrp1.deja.com>

Sorry for the newbie question.

actually, to clarify ...
I wanted to use split() in a 'while' loop for many similar lines,

"AAA"\t"BBB"\t"CCC\nDDD\nEEE\nFFF"\n
"AAA"\t"BBB"\t"CCC\nDDD\nEEE\nFFF"\n

but it doesn't work because of the \n's in the third field.

while (<FILE>){
  ($a, $b, $c ) = split (/\t/, $_);
}

I may be able to strip out the \n's before the last \n but I was
wondering if there was a easier way to accomplish this.

thanks

In article <80esu6$20n$1@nnrp1.deja.com>,
  gkl200 <gkl200@my-deja.com> wrote:
> Hi, is there a Perl function or an easy way to parse the following
line
> of data below into three fields? I want to take exported tab delimited
> text data from MSAccess and import into MySQL.
>
> I know I can use MySQL's "LOAD DATA INLINE" function, but I was
> wondering if there was a similar function in Perl.
> thanks
>
> data:
> "AAA"\t"BBB"\t"CCC\nDDD\nEEE\nFFF"\n
>
> becomes:
> $field1 = "AAA"
> $field2 = "BBB"
> $field3 = "CCC\nDDD\nEEE\nFFF"
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Thu, 11 Nov 1999 21:37:13 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Parse delimited file with \n's.
Message-Id: <80f9ds$sonr$1@fu-berlin.de>

gkl200 <gkl200@my-deja.com> wrote in message
news:80esu6$20n$1@nnrp1.deja.com...
> Hi, is there a Perl function or an easy way to parse the following
> line of data below into three fields? I want to take exported tab
> delimited text data from MSAccess and import into MySQL.
>
> data:
> "AAA"\t"BBB"\t"CCC\nDDD\nEEE\nFFF"\n
>
> becomes:
> $field1 = "AAA"
> $field2 = "BBB"
> $field3 = "CCC\nDDD\nEEE\nFFF"
>
In any case: just ignore the recommendations to use split() for this
task (its just a waste of time). You may kindly request the guys who
recommend the use of split to show you a working solution for your
problem.

Take a look at modules like Text::CSV_XS or DBD::CSV. They are much
more appropriate for this kind of task.

Here (again) one of my usage examples of Text::CSV_XS (btw. it also
shows that K. Bandes - in another thread - is wrong, when he claims,
that this module is unable to handle multiline fields. But the other
comments he made about the coverage of the CSV story in the FAQ are
mostly correct.):

#!/wherever/perl -w
use strict;
use Text::CSV_XS;

my $csv = Text::CSV_XS->new({ binary => 1, sep_char => "\t" });

my $buffer = "";
my $success = undef;
my $rec_count = 0;

while(<DATA>) {
  $buffer .= $_;
  $success = $csv->parse($buffer);
  if ($success) {
    display_record(++$rec_count, $csv->fields());
    $buffer = "";
  }
}
if (not $success) {
  my $err = $csv->error_input();
  print "parse CSV failed at:\n", $err, "\n";
}

sub display_record {
  my $rec_count = shift;
  my @fields = @_;
  my $field_count = 0;

  print "Record: $rec_count [\n";
  foreach my $field (@fields) {
    print "Field: ", ++$field_count, " = ", $field, "\n";
  }
  print "] $rec_count\n";
}

__DATA__
"AAA" "BBB" "CCC
DDD
EEE
FFF"
"AAA" "B""B""B" "C CC
DDD
EEE
FFF"
a b c


This prints:
Record: 1 [
Field: 1 = AAA
Field: 2 = BBB
Field: 3 = CCC
DDD
EEE
FFF
] 1
Record: 2 [
Field: 1 = AAA
Field: 2 = B"B"B
Field: 3 = C    CC
DDD
EEE
FFF
] 2
Record: 3 [
Field: 1 = a
Field: 2 = b
Field: 3 = c
] 3

(I am sorry to have used <Tabs> in this posting. I know that <Tabs>
are inappropriate on usenet, because of their nonportability.)




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

Date: Thu, 11 Nov 1999 13:13:32 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Passing arrays + other arguments to a subroutine
Message-Id: <x3ypuxgrj5f.fsf@tigre.matrox.com>


irf@netexecutive.com writes:

> however, what if i want to pass other arguments to the subroutine,
> for example,
> 
> mySub(@xArray, $xVar, $yVar, zVar); ?
> 
> Now, within the sub, I would like to access $xVar by using $_[1],
> $yVar by using $_[2] and so on.

You pass the array by reference. Checkout perlsub and perlref for more
info.

> ---
> @myArray=("go", "come", "as", "you", "are");
> $text="any Text";
> 
> &refTest (\@myArray, $text);
> 
> sub refTest{
>  #this is how i would like to access the array that is passed
>   foreach $element(@$_[0]){
>     print "myArray from sub: $key<BR>";
                               ^^^^
                               ^^^^
What is $key? Shouldn't it be $elements?

>   }
> 
>  #Here is where I would like to access the second parameter
>   print "$_[1]";
> }

If you change $key to $element, the little snippet will do what you
want.

--Ala



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

Date: Thu, 11 Nov 1999 22:09:29 GMT
From: irf@netexecutive.com
Subject: Re: Passing arrays + other arguments to a subroutine
Message-Id: <80feqm$g8v$1@nnrp1.deja.com>


> >   foreach $element(@$_[0]){
> >     print "myArray from sub: $key<BR>";
>                                ^^^^
>                                ^^^^
> What is $key? Shouldn't it be $elements?

> If you change $key to $element, the little snippet will do what you
> want.

yeah, sorry - i changed it from $key in my actual code to $element
(for clarity!), and must have overseen that. but the snippet does
not work even if everything is in concord, which is why i put the
question up.

Thank everyone, for the info, time to go find those perlref & perlsub
docs!



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


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

Date: 11 Nov 1999 20:52:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Extensions. Arrgh.
Message-Id: <80faa9$3on$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dan Sugalski 
<dan@tuatha.sidhe.org>],
who wrote in article <bDAW3.2983$c06.25659@news.rdc1.ct.home.com>:
> > My question was about the result of conversion to C.
> 
> The return's an SV. *All* returns from an XS module are ultimately SVs.

Then I understand your initial remark as advocating

  SV *
  foo()
    CODE:
	RETVAL = 5;
    OUTPUT:
	RETVAL

as working?

Ilya


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

Date: Thu, 11 Nov 1999 13:58:58 -0500
From: Seshadri <seshadri@ptc.com>
Subject: Re: Perl Interpreter in Java
Message-Id: <382B11F2.8268BF92@ptc.com>

Is jperl beta not the one you are looking for? Dunno what it does
though....

- Sesh


Nimrod Shaulski wrote:

> Hi all.
> I'm looking for a perl interpreter written on Java (so I can activate
> scripts from inside my Java application).
> Does anyone know something about it?
> Thanks a lot.



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

Date: Thu, 11 Nov 1999 19:33:31 GMT
From: salvadorej@my-deja.com
To: lr@hpl.hp.com
Subject: Re: Problem: MySQL, variable scope, references
Message-Id: <80f5mb$924$1@nnrp1.deja.com>


> >         my $i=0;
> >         while(%queryhash = $qh->FetchHash())
> >         {
> >                 $queryhashes[$i]=\%queryhash;
> >                 $i++;
> >         }
>
> A conjecture that it would take too long for me to test:
>
> All the references to hashes that you are storing are to the same
> hash. The contents of each one are overwriting the contents of
> the previous  one.  When the null return comes back, it wipes out the
> last contents, so they are all empty.

This is exactly what was happening.

> Try using this: while(my %queryhash = $qh->FetchHash())

And this does indeed work.

Thank you very much!


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


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

Date: Thu, 11 Nov 1999 16:20:12 -0500
From: "Tony White" <whian03@bellsouth.net>
Subject: Problems using $^O and $Config{'archname'}
Message-Id: <80fc2n$82g$1@isrv1.hbocvan.com>

I've tried using $^O and $Config('archname'} on an HP/UX machine and on an
NT machine.  The $^O works on the NT machine, but not on the HP/UX machine.
$Config{'archname'} doesn't work on either machine.  Does anybody know why?

As I understand it, $^O is simply the equivalent of 'uname -s' on UNIX
boxes - it's very strange that it works on an NT box, but not on a UNIX box.

BTW, I'm using ActiveState Perl 5.005_02 build 507 on NT and various
versions of Perl on HP/UX machines (one is 4.0.1.8 and the other is 5.003).

TIA

--


Tony White
Implementation Consultant, Computer Associates
whian03@bellsouth.net
(404) 338-2673





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

Date: Thu, 11 Nov 1999 11:38:36 -0800
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: Q: Instructions for embedding Perl in Borland Delphi
Message-Id: <382B1B3C.23CE7923@midnightbeach.com>

> Has anyone had any luck with using PerlEz from Delphi? DejaNews only
> showed this message and an older one, and neither had any replies.

I got this to work, mostly. You can find the basic and OO bindings, as
well as archived discussion (if any!) at
http://www.onelist.com/community/PerlEzD.

Caveats:

1) Standard globbing doesn't work. You have to use the DosGlob package,
which is part of the standard Active State distribution.

2) The code to capture StdOut currently doesn't work, though according
to dougl it should.

3) The 'magic' (tied) scalars only seem to work in a read-only mode. Any
attempt to set them results in an error.

-- 

http://www.midnightbeach.com    - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages


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

Date: Thu, 11 Nov 1999 22:46:23 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: Q: Instructions for embedding Perl in Borland Delphi
Message-Id: <80fgvu$i1v$1@nnrp1.deja.com>

In article <382B1B3C.23CE7923@midnightbeach.com>,
  jon@midnightbeach.com wrote:
> > Has anyone had any luck with using PerlEz from Delphi? DejaNews only
> > showed this message and an older one, and neither had any replies.
>
> I got this to work, mostly. You can find the basic and OO bindings, as
> well as archived discussion (if any!) at
> http://www.onelist.com/community/PerlEzD.
>
> Caveats:
>
> 1) Standard globbing doesn't work. You have to use the DosGlob
package,
> which is part of the standard Active State distribution.


Not surprising, since the globbing is done by an external application
(csh in Unix, perlglob.bat in dos/windows).

If you can, the best way to do globbing is to use readdir() combined
with grep(). See "perldoc -f readdir" for an example.



> 2) The code to capture StdOut currently doesn't work, though according
> to dougl it should.

Don't really know what this means, and if it's a Perl or Delphi
problem. Stdout/Stdin/Stderr redirection under command.com is flaky.



> 3) The 'magic' (tied) scalars only seem to work in a read-only mode.
Any
> attempt to set them results in an error.

Ugh!



--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"


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


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

Date: 11 Nov 1999 16:28:24 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Removing leading zeros from a string?
Message-Id: <80eqr8$jht$1@gellyfish.btinternet.com>

On Thu, 11 Nov 1999 14:08:23 GMT Burt lewis wrote:
> Hello,
> 
> I know how to remove leading and trailing spaces ok
> for ($string) {
>             s/^\s+//;
>             s/\s+$//;
>         }
> 
> But I have a string that looks like this:
> 00000123456
> 

You already know how to do it with a regular expression if you think
about it - but you might also consider the following - a consequence of
Perls magic regarding numbers and strings that look like numbers :

$number = '00000012345';

print $number,"\n";

$number += 0;

print $number,"\n";

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 11 Nov 1999 12:57:06 -0800
From: "David Winsen" <david@hotjobs2000.com>
Subject: Senior Software Engineer (Perl)-Positions Available
Message-Id: <GYFW3.144$yd1.10179@typhoon-la.pbi.net>

Senior Software Engineer (Perl)-Positions Available

URGENT MESSAGE!

From:  David Winsen - Senior Consultant - High Technology Executive Search
(HTES)

We have an out-dated copy of your resume in our database or have viewed your
credentials on the internet.  HTES is an established national Executive
Search and Consulting Firm who has been serving the High Tech Industries for
over 25 years.

We have been confidentially retained by a San Jose, Ca. company that has
developed a Web-based enterprise application that enables global companies
to transform a single-language Web site into a centrally managed
multilingual Web presence.

We are confidentially pre-screening top candidates for the following
position(s):
Senior Software Engineer (Perl)

Technical-Qualifications-and-Skills:

 . A BS in Computer Science or related field or equivalent experience. 6+
years experience in software product development. 2+ years in web related
product development,,technologies-and-solutions.
 . 2+ years advanced Perl programming (Object oriented Perl 5.x)
 . Experience building web-based applications with Perl/Mod Perl and/or
Apache
 ..Experience-using-DBI/DBD-for-major-databases
 ..Significant understanding of SQL and database development
 . 2+ years experience in object oriented design and programming such as C++
 . Excellent technical background in Internet technologies. At least 2 years
experience in application development utilizing some of the following web
technologies: D/HTML, CSS, JavaScript, ASP, XML, Java, JFC, SWING, IFC,
JavaBeans, CGI, Perl, web servers on Windows NT or Sun Solaris.
 . Experience with low level technologies is a plus: HTTP, SSL, ISAPI, NSAPI,
etc.
 . Experience interfacing with SQL database servers: ODBC, JDBC, OCI, DBLIB,
SQL, etc.
 ..Experience-with-application-and-database-servers.
 ..A-proven-track-record-in-software-development.
 ..Knowledge-and-experience-with-Unix-and-Windows-NT.
 ..Sound-knowledge-of-product-development-cycle.
 ..Experience and appreciation of international software development and an
understanding-of-the-issues-is-a-major-plus.





Non-Technical-Qualifications-and-Skills:

 . Have the desire and commitment to produce successful, quality, real-world
multilingual-Web-solutions.
 ..Must-be-self-motivated-and-enthusiastic.
 ..Must-enjoy-working-as-part-of-a-close-knit-team.
 ..Have-a-results-and-objectives-oriented-approach.
 ..Have-high-productivity-of-high-quality.
 ..Have-excellent-software-development-practices.
 ..Have-excellent-interpersonal-verbal-and-written-skills.
 ..Have-excellent-planning-and-organization-skills.

Responsibilities:

 . Key engineering staff member responsible for the design and development of
multilingual-web-products.
 . Ensure engineering continues to be architecturally sound and meet the
product requirements including that of the customers, cultures, languages
and all relevant standards.
 . Assist in design of product features, high-level and detailed design
documents.
 ..Enhance-and-maintain-existing-product-capabilities.
 . Help to ensure total product quality.

 ..Competitive-salary-and-benefits-package
 ..Stock-Options
 ..401(k)
 . Liberal leave policy, incl. 3 weeks vacation/year and maternity/paternity
leave
 . Culturally diverse, international team of employees

If you are interested, please E-mail me in MS Word 95-98 a recent copy of
your resume and a cover letter with your specific information, including
your recent compensation package to
Position(s) for:

My personal E-mail is david@hotjobs2000.com or fax your resume to (310)
855-0840. If you have any questions about the position(s), please call me at
(310) 855-0406 and I will discuss them in detail.


We also have developed an interactive Website that you can view over 6000
national openings www.hotjobs2000.com .  This system is effective, easy to
use and new positions are posted daily.  We encourage you to use it and
nominate yourself for other positions you feel you are qualified for.  We
are looking forward to working with you now and in the future.








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

Date: 11 Nov 1999 14:27:31 -0700
From: Eric The Read <emschwar@rmi.net>
To: "David Winsen" <david@hotjobs2000.com>
Subject: Re: Senior Software Engineer (Perl)-Positions Available
Message-Id: <xkfr9hw7m7w.fsf@valdemar.col.hp.com>

"David Winsen" <david@hotjobs2000.com> writes:
> Senior Software Engineer (Perl)-Positions Available

Okay, this was posted in comp.lang.perl.misc.  Do you see the word "jobs" 
in there?  Anywhere?  I didn't think so.

> URGENT MESSAGE!

To you, maybe.  The vast majority of us could care less.

> From:  David Winsen - Senior Consultant - High Technology Executive Search
> (HTES)

Are you sure that doesn't stand for "He Ties Excellent Shoelaces"?
Because the level of clues you display in this article don't show that
you're particularly qualified to search for jobs for McDonald's cashiers, 
much less "High Technology Executives".

> We have an out-dated copy of your resume in our database or have viewed your
> credentials on the internet.

Since when did 

Newsgroups: comp.lang.perl.misc

have a resume, or credentials of any kind?  Oh, wait, that's right.  Not
only did you post a job offer to a group that isn't intended for such,
you didn't even bother to customize it for your putative audience.  Well, 
that certainly inspires me to trust you!

> HTES is an established national Executive
> Search and Consulting Firm who has been serving the High Tech Industries for
> over 25 years.

That's nice, dear.

> We have been confidentially retained by a San Jose, Ca. company that has
> developed a Web-based enterprise application that enables global companies
> to transform a single-language Web site into a centrally managed
> multilingual Web presence.

Poor bastards.  They could have gone with somebody who had a clue, but
instead they chose you.  Oh, well.

> We are confidentially pre-screening top candidates for the following
> position(s):

You don't know how many positions you're pre-screening for, and you still 
post this?  This just *SCREAMS* "I couldn't be bothered to actually write 
anything, so I'll just use my generic mail-merge, they'll never notice."

Do you really *want* candidates who would fall for crap like this?

> Senior Software Engineer (Perl)
> 
> Technical-Qualifications-and-Skills:

<snip>

Why didn't you just say, "Knows something about databases, and Perl."
Because that's about what all those buzzwords amount to.

> Non-Technical-Qualifications-and-Skills:
> 
> . Have the desire and commitment to produce successful, quality, real-world
> multilingual-Web-solutions.
> ..Must-be-self-motivated-and-enthusiastic.

"Will work 20-hour days, and never ask for overtime."

> ..Must-enjoy-working-as-part-of-a-close-knit-team.

"Handle input from 5 other people who don't know what they're doing either."

> ..Have-a-results-and-objectives-oriented-approach.

"Look, it compiles!  Ship it!"

> ..Have-high-productivity-of-high-quality.

"We'll pay you $5 for each bug you fix."

> ..Have-excellent-software-development-practices.

"So we don't have to pay you that $5."

> ..Have-excellent-interpersonal-verbal-and-written-skills.

 ..Like-using-hypens-all-the-damn-time-instead-of-spaces?

> ..Have-excellent-planning-and-organization-skills.

 ..Nobody-can-figure-out-what-you're-doing-so-you'd-better-use-very-small-words.

> Responsibilities:
> 
> . Key engineering staff member responsible for the design and development of
> multilingual-web-products.

"Translate this into Spanish.  And Japanese.  By Monday."

> . Ensure engineering continues to be architecturally sound and meet the
> product requirements including that of the customers, cultures, languages
> and all relevant standards.

"We don't know what it should do, but you ought to."

> . Assist in design of product features, high-level and detailed design
> documents.

"We won't give you time to document it, but we'll expect you to, anyway."

> ..Enhance-and-maintain-existing-product-capabilities.
> . Help to ensure total product quality.

"Fix all the bugs our last guy didn't before he left, screaming."

> ..Competitive-salary-and-benefits-package

 ..Again-with-the-buzzwords-and-lame-hyphens.
 ..What-gives?

> ..Stock-Options

 ..Which-will-likely-be-worthless-given-the-state-of-the-market-for-internet-IPOs 

> ..401(k)

"Our accountant claims he knows what this means."

> . Liberal leave policy, incl. 3 weeks vacation/year and maternity/paternity
> leave

 . We-comply-with-all-federal-laws-but-advertise-them-as-competitive-advantage.

Oh, wait, sorry, you started using spaces again.  My bad.

> . Culturally diverse, international team of employees

"None of which live anywhere near you.  Get used to conference calls at
7pm."

> If you are interested, please E-mail me in MS Word 95-98

Despite the fact that any decent programmer already has it in LaTeX or
even ASCII.

> a recent copy of
> your resume and a cover letter with your specific information, including
> your recent compensation package to
> Position(s) for:

Okay... but I don't think the Post Orifice will like that very much.  And 
it's an invalid email address to, so I don't know how you expect anybody
to get this back to you.

> My personal E-mail is david@hotjobs2000.com or fax your resume to (310)
> 855-0840. If you have any questions about the position(s), please call me at
> (310) 855-0406 and I will discuss them in detail.

Don't sweat it, I've already taken care of that for you.

> We also have developed an interactive Website that you can view over 6000
> national openings www.hotjobs2000.com .

Hopefully, none of them are conditional upon your using decent
punctuation or grammar.

> This system is effective, easy to use and new positions are posted
> daily.

"Because we have to keep new jobs coming in, as our previous leads got
sick of the unqualified people we kept sending them, and sacked us."

> We encourage you to use it and nominate yourself for other positions
> you feel you are qualified for. 

I feel qualified for King of the World.  Do you guys handle that account?

> We are looking forward to working with you now and in the future.

I doubt it.

-=Eric
-- 
"Perl already has _bless_, and we know what it does...  [it] should also
 have _smite_, and we know what it should do, too.  If more languages had
 _smite_ implemented, the remaining programmers would be better than the
 current average." -- Mike Andrews in the scary.devil.monastery


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

Date: 11 Nov 1999 20:03:50 GMT
From: edew@netcom.com (Eric Dew)
Subject: Some more questions on modules' usage
Message-Id: <80f7f6$rsq$1@nntp5.atl.mindspring.net>

Ok, I've got the hang of using modules with some main scripts (thanks all!).

Here's the deal.  I have a file which contains just aliases:

#----Top of file, list.pl----
$CO	= "/usr/local/bin/co";
$CI	= "/usr/local/bin/ci";
 ...

It's good practice to do something like this because if and when commands
are moved, one goes to just one file (list.pl) and edit the list of command
paths.  Also, some systems may have different versions of commands located
in different places.  (For example, some system may have a make in /usr/bin
and make in /usr/local/bin which is symlinked to /usr/local/bin/gmake, and
it's the gmake version of make that one wants to use.)

Anyway, my script needs to use the commands, so in my main script, I have:

#!/usr/local/bin/perl
[. . .]
require("list.pl");

[. . .]
use SomeModule; #a module to be because of the functions defined therein.
[. . .]

Now, the functions defined in SomeModule.pm would ALSO like to use the
commands defined in list.pl.

So, one might imagine doing this in the SomeModule.pm file:

package	SomeModule;
require	Exporter;
[. . .]
require("list.pl");
[. . .]

Well, what happens is that the module knows the value of $CO and $CI, but
the main script loses that information.

That is, if I were to put
	print "CO is $CO and CI is $CI\n";
in the module file and the main script file, the output from the module's
print will be:
CO is /usr/local/bin/co and CI is /usr/local/bin/ci
while the output from the main script will be:
CO is  and CI is 

So the question is, how do I do it right so that both the main script and
module share the list of variable definitions without one un-doing the
other?

Thanks,

EDEW



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

Date: Thu, 11 Nov 1999 20:59:01 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: sorting withing multiple files
Message-Id: <382b2cf8.20490426@news.enteract.com>

I have 100's of comma delimited files(all in the same directory and
all with the format *******s.log) that the third entry is an IP
address.  That's the only field I'm interested in.  I want to see how
many unique IP addresses there are in the files.  This is cumulative
so if the same IP is in 15 files, that only counts as one.  So
basically worst case I would like to loop thru all the files and read
the IP's into a massive array and then sort and count when the address
changes add one.  Is there a good way to do this?  Thanks.

Steve

Newsgroup replies preferred.  Remove nospam when replying thru email.


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

Date: Fri, 12 Nov 1999 10:50:17 +1300
From: Matthew Stevenson <mj.stevenson@auckland.ac.nz>
Subject: Re: sorting withing multiple files
Message-Id: <382B3A19.9165EAF4@auckland.ac.nz>

"Steve ." wrote:
> 
> I have 100's of comma delimited files(all in the same directory and
> all with the format *******s.log) that the third entry is an IP
> address.  That's the only field I'm interested in.  I want to see how
> many unique IP addresses there are in the files.  This is cumulative
> so if the same IP is in 15 files, that only counts as one. 

Use a hash as with the ip number as the key as it will be unique. Then
count the keys with...

$num = scalar keys %hash

Matthew
-- 

Matthew Stevenson
University of Auckland
mj.stevenson@auckland.ac.nz
mavricknz@yahoo.com


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

Date: Thu, 11 Nov 1999 14:31:18 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: sorting withing multiple files
Message-Id: <MPG.1294e391c3a3f0bb98a1e0@nntp.hpl.hp.com>

In article <382b2cf8.20490426@news.enteract.com> on Thu, 11 Nov 1999 
20:59:01 GMT, Steve . <syarbrou@nospam.enteract.com> says...
> I have 100's of comma delimited files(all in the same directory and
> all with the format *******s.log) that the third entry is an IP
> address.  That's the only field I'm interested in.  I want to see how
> many unique IP addresses there are in the files.  This is cumulative
> so if the same IP is in 15 files, that only counts as one.  So
> basically worst case I would like to loop thru all the files and read
> the IP's into a massive array and then sort and count when the address
> changes add one.  Is there a good way to do this?

Yes, but it's *not* the way you suggest.

1.  `perldoc -q unique` will get you to perlfaq4: "How can I extract 
just the unique elements of an array?"

2.  Use a hash (like solution b in the FAQ).  Here is the whole program 
in a 'one-liner':


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

my %seen;
 
$seen{(split /,/)[2]} = 1 while <>;

print "There are ", scalar keys %seen, " unique IP addresses\n";

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


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

Date: Thu, 11 Nov 1999 21:51:30 GMT
From: rancorr@hotmail.com
Subject: supress '$' symbol
Message-Id: <80fdp0$flr$1@nnrp1.deja.com>

in my perl code, i have the following variable:

$amt = "$9,000";

the perl interpreter thinks $9,000 is a variable name, when it's
supposed to be a string.  i thought doing this:

$amt = "$$9,000";

would solve my problems but apparently not.

what would be hte correct way to solve this?


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


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

Date: Thu, 11 Nov 1999 22:02:53 GMT
From: raju_k@iname.com
Subject: Re: supress '$' symbol
Message-Id: <80feea$g57$1@nnrp1.deja.com>





In article <80fdp0$flr$1@nnrp1.deja.com>,
  rancorr@hotmail.com wrote:
> in my perl code, i have the following variable:
>
> $amt = "$9,000";
>
> the perl interpreter thinks $9,000 is a variable name, when it's
> supposed to be a string.  i thought doing this:

[SNIP]

$amt = '$9,000';
Things in double quotes are interpretted, things in single quote are
not

--raju


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


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

Date: 11 Nov 1999 22:15:33 GMT
From: edew@netcom.com (Eric Dew)
Subject: Re: supress '$' symbol
Message-Id: <80ff65$h4i$1@nntp4.atl.mindspring.net>

In article <80fdp0$flr$1@nnrp1.deja.com>,  <rancorr@hotmail.com> wrote:
>in my perl code, i have the following variable:
>
>$amt = "$9,000";
>
>the perl interpreter thinks $9,000 is a variable name, when it's
>supposed to be a string.  i thought doing this:
>
>$amt = "$$9,000";
>
>would solve my problems but apparently not.
>
>what would be hte correct way to solve this?
>

Using single quotes remove properties of meta characters:
 $amt = '$9000';

Or, use backslash:

print "\$9000 is a lot of money\n";

EDEW


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

Date: Thu, 11 Nov 1999 17:20:21 -0500
From: Seshadri <seshadri@ptc.com>
Subject: Re: supress '$' symbol
Message-Id: <382B4124.58FDB8EF@ptc.com>


rancorr@hotmail.com wrote:

> in my perl code, i have the following variable:
>
> $amt = "$9,000";
>
> the perl interpreter thinks $9,000 is a variable name, when it's
> supposed to be a string.  i thought doing this:
>
> $amt = "$$9,000";
>
> would solve my problems but apparently not.
>
> what would be hte correct way to solve this?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

It all depends on what you are trying to accomplish. From what I see,
you have an amount of 9000 dollars and you want to (say) add 100 dollars
to it to get 9100 dollars and print out the final amount. If this is
what you want, it's pretty simple.

#!/usr/bin/perl

my $amt = 9000;
my $int   = 100;
my $total = $amt + $int;
print "\$$total", "\n"; # prints $9100

HTH

- Sesh



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

Date: 11 Nov 1999 20:48:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: use overload -- "0+" takes the place of "bool"
Message-Id: <80fa3i$3o4$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Jonathan Stowe 
<gellyfish@gellyfish.com>],
who wrote in article <80e6dn$j5d$1@gellyfish.btinternet.com>:
> On Thu, 11 Nov 1999 16:38:06 +0800 John Lin wrote:
> > 
> > I think it is worthy revise the overloading behavior in this case.
> > 
> 
> 'Patches always welcome' ...

Too late...  I think this was corrected this summer.  Due to a
misprint a translator '0+'/'""' ---> 'bool' was checking for
definedness instead of truth.

Ilya


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

Date: Thu, 11 Nov 1999 13:07:47 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Virus
Message-Id: <x3yr9hwrjf0.fsf@tigre.matrox.com>


goetz@cse.buffalo.edu (Phil Goetz) writes:

> So nobody else on this newsgroup has a problem with people posting virii?
> Plenty better things to work on and post.

A virus is not necessarily a bad thing.

--Ala



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

Date: Thu, 11 Nov 1999 22:34:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Virus
Message-Id: <6wHW3.47$GC6.2005@nsw.nnrp.telstra.net>

On 11 Nov 1999 14:49:31 GMT,
	Phil Goetz <goetz@cse.buffalo.edu> wrote:
> 
> So nobody else on this newsgroup has a problem with people posting virii?
> Plenty better things to work on and post.

If no one ever looked at viruses, except the baddies, there would be
no defense.

If no one ever was allowed to discuss the ways in which a virus can be
constructed, then the people with white hats won't know about the
problems.

This goes for all areas of security and data protection. That's why
programs like satan are a Good Thing (TM), even though the dark
underbelly of the black hat community gets a copy as well. Because it
makes the people responsible for systems aware of potential security
problems _before_ the black hats get a chance to exploit them.

It's the responsibility of programmers to write decent code. It's the
responsibility of systems admins to run that code in a secure
environment. If those sysadmins don't know what the potential security
problems are, then they won't be able to do anything about it.

In this case it's simple: chmod 555 everything.

You're not a hacker(1), are you?

Martien

PS. Please, note that I said _hacker_, not _cracker_. Irrespective of
what the lesser educated media seems to think, they're a totally
different beast.
-- 
Martien Verbruggen              | 
Interactive Media Division      | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.   | Gates?
NSW, Australia                  | 


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

Date: 11 Nov 1999 17:02:57 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Virus
Message-Id: <80ess1$ji9$1@gellyfish.btinternet.com>

On 11 Nov 1999 14:49:31 GMT Phil Goetz wrote:
> In article <x3ybt92yyqx.fsf@tigre.matrox.com>,
> Ala Qumsieh  <aqumsieh@matrox.com> wrote:
>>
>>abigail@delanet.com (Abigail) writes:
>>
>>>                         unless ($program =~ /# HACKED/) {
>>>                             $program =~ s/\n/\n$text/;
>>>                         }
>>
>>Not a very smart virus. Very easy to fool. Just stick a '# HACKED'
>>somewhere in the code.
>>
>>But a cool virus nevertheless.	
>>
> So nobody else on this newsgroup has a problem with people posting virii?
> Plenty better things to work on and post.
> 

OK then work on them and post them ...  It was an intersting program - it
only becomes a virus if you are stupid enough to run it ,

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

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


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