[18534] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 702 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 15 09:05:32 2001

Date: Sun, 15 Apr 2001 06:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987339909-v10-i702@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 15 Apr 2001     Volume: 10 Number: 702

Today's topics:
        FAQ .:   Bundled Distributions <faq@denver.pm.org>
        FAQ .:   What will happen if you mail your Perl program <faq@denver.pm.org>
    Re: Flame Target <comdog@panix.com>
    Re: Flame Target <msoftmonkeySPAM@crosswinds.net>
    Re: Flame Target <mda@idatar.com>
    Re: Flame Target <gellyfish@gellyfish.com>
    Re: Flame Target <bart.lateur@skynet.be>
    Re: Flame Target <atkeizer@lucent.com>
    Re: Graphics in windows?? <bart.lateur@skynet.be>
    Re: Is a function/class library for processing of SMTP- <JeffH@ActiveState.com>
    Re: need help cgi/perl/form variables <gellyfish@gellyfish.com>
    Re: New NG member - seeks a little help :) <gellyfish@gellyfish.com>
        OT(?): SSI vs. Non-SSI <ofirb1@netvision.net.il>
    Re: OT(?): SSI vs. Non-SSI <flavell@mail.cern.ch>
        Premature end of script headers? <pric3596@cs.uidaho.edu>
    Re: Premature end of script headers? <joe+usenet@sunstarsys.com>
        SV: perl equivalent for (char) long_var in C ? <chho@privat.utfors.se>
    Re: SV: perl equivalent for (char) long_var in C ? <bart.lateur@skynet.be>
    Re: SV: perl equivalent for (char) long_var in C ? (Jay Tilton)
    Re: to get a PId <iltzu@sci.invalid>
    Re: why i posted (Logan Shaw)
    Re: why i posted <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 15 Apr 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ .:   Bundled Distributions
Message-Id: <2jgC6.1085$T3.194068480@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  Bundled Distributions

    When included as part of the Standard Version of Perl, or as part of its
    complete documentation whether printed or otherwise, this work may be
    distributed only under the terms of Perl's Artistic License. Any
    distribution of this file or derivatives thereof *outside* of that
    package require that special arrangements be made with copyright holder.

    Irrespective of its distribution, all code examples in these files are
    hereby placed into the public domain. You are permitted and encouraged
    to use this code in your own programs for fun or for profit as you see
    fit. A simple comment in the code giving credit would be courteous but
    is not required.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep comming up.  If you are some how irritated by
seeing these postings you are free to ignore them or add the sender
to your killfile.  If you find errors or other problems with these
postings please send corrections or comments to the posting email
address.

If you are not able to find this or other Perl documentation from
your installation you may access it via the web by following the
appropriate links from one of the addresses listed below.

    http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search
    http://www.perldoc.com
    http://www.cpan.org
    http://www.perl.com

Answers to questions about LOTS of other stuff, mostly not related to
Perl, can be found at

    news:news.answers

and in the many thousands of other useful Usenet news groups.

Please note that the FAQ text posted by this server has been modified
from that distributed in the stable Perl release.  It has been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ is available on request.

The perlfaq manual pages contain the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

    When included as an integrated part of the Standard
    Distribution of Perl or of its documentation (printed or
    otherwise), this work is covered under Perl's Artistic
    License.  For separate distributions of all or part of
    this FAQ outside of that, see the perlfaq manpage.

    Irrespective of its distribution, all code examples here
    are public domain.  You are permitted and encouraged to
    use this code and any derivatives thereof in your own
    programs for fun or for profit as you see fit.  A simple
    comment in the code giving credit to the FAQ would be
    courteous but is not required.

This work is provided in the hope that it will be useful but does
not represent a commitment of any kind on the part of the contributers,
authors or their agents.
-- 
    This space intentionally left blank


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

Date: Sun, 15 Apr 2001 06:17:00 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ .:   What will happen if you mail your Perl programming problems to the authors
Message-Id: <w1bC6.1084$T3.197463552@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  What will happen if you mail your Perl programming problems to the authors

    Your questions will probably go unread, unless they're suggestions of
    new questions to add to the FAQ, in which case they should have gone to
    the perlfaq-suggestions@perl.com instead.

    You should have read section 2 of this faq. There you would have learned
    that comp.lang.perl.misc is the appropriate place to go for free advice.
    If your question is really important and you require a prompt and
    correct answer, you should hire a consultant.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep comming up.  If you are some how irritated by
seeing these postings you are free to ignore them or add the sender
to your killfile.  If you find errors or other problems with these
postings please send corrections or comments to the posting email
address.

If you are not able to find this or other Perl documentation from
your installation you may access it via the web by following the
appropriate links from one of the addresses listed below.

    http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search
    http://www.perldoc.com
    http://www.cpan.org
    http://www.perl.com

Answers to questions about LOTS of other stuff, mostly not related to
Perl, can be found at

    news:news.answers

and in the many thousands of other useful Usenet news groups.

Please note that the FAQ text posted by this server has been modified
from that distributed in the stable Perl release.  It has been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ is available on request.

The perlfaq manual pages contain the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

    When included as an integrated part of the Standard
    Distribution of Perl or of its documentation (printed or
    otherwise), this work is covered under Perl's Artistic
    License.  For separate distributions of all or part of
    this FAQ outside of that, see the perlfaq manpage.

    Irrespective of its distribution, all code examples here
    are public domain.  You are permitted and encouraged to
    use this code and any derivatives thereof in your own
    programs for fun or for profit as you see fit.  A simple
    comment in the code giving credit to the FAQ would be
    courteous but is not required.

This work is provided in the hope that it will be useful but does
not represent a commitment of any kind on the part of the contributers,
authors or their agents.
-- 
    This space intentionally left blank


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

Date: Sun, 15 Apr 2001 00:09:10 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Flame Target
Message-Id: <comdog-3166A2.00091015042001@news.panix.com>

In article <9bb38j$8jbaf$1@ID-50051.news.dfncis.de>, "Joseph André" 
<msoftmonkeySPAM@crosswinds.net> wrote:

> print <<END;
> 
> Content-Type: text/html\n\n

what's that extra line doing there?

-- 
brian d foy <comdog@panix.com>



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

Date: Sun, 15 Apr 2001 00:22:41 -0400
From: "Joseph André" <msoftmonkeySPAM@crosswinds.net>
Subject: Re: Flame Target
Message-Id: <9bb7p2$86md3$1@ID-50051.news.dfncis.de>

I don't know, I was told to put it there. Is that the cause of my problem?

--
Your basis everything belongs to me, it is! I am the Zoltan of for the sake
of! Huzzah!
-Joe


"brian d foy" <comdog@panix.com> wrote in message
news:comdog-3166A2.00091015042001@news.panix.com...
> In article <9bb38j$8jbaf$1@ID-50051.news.dfncis.de>, "Joseph André"
> <msoftmonkeySPAM@crosswinds.net> wrote:
>
> > print <<END;
> >
> > Content-Type: text/html\n\n
>
> what's that extra line doing there?
>
> --
> brian d foy <comdog@panix.com>
>




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

Date: Sun, 15 Apr 2001 06:52:22 GMT
From: "David Allen" <mda@idatar.com>
Subject: Re: Flame Target
Message-Id: <GybC6.1651$lc.1499962@typhoon1.ba-dsg.net>

In article <9bb7p2$86md3$1@ID-50051.news.dfncis.de>, "Joseph André"
<msoftmonkeySPAM@crosswinds.net> wrote:

> I don't know, I was told to put it there. Is that the cause of my problem?

No, the extra line isn't the problem.  That doesn't have any effect at all.

The proxy error that you're getting doesn't sound like it has anything to do
with your program.  It sounds like you're not able to properly connect to 
their webserver for whatever reason.

Does this happen if you try to fetch other files from the webserver?

-- 
David Allen
http://opop.nols.com/
----------------------------------------
 'Hey Look! It's not my fault; It's some guy named "General Protection."' 
		- Ratbert


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

Date: 15 Apr 2001 09:48:36 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Flame Target
Message-Id: <9bbqpk$7vb$1@neptunium.btinternet.com>

David Allen <mda@idatar.com> wrote:
> In article <9bb7p2$86md3$1@ID-50051.news.dfncis.de>, "Joseph André"
> <msoftmonkeySPAM@crosswinds.net> wrote:
> 
>> I don't know, I was told to put it there. Is that the cause of my problem?
> 
> No, the extra line isn't the problem.  That doesn't have any effect at all.
> 

Maybe it isnt the cause of the actual problem it is still wrong as the
'Content-type: text/html' header shows up in the generated page.

I think the OP should ask in comp.infosystems.www.authoring.cgi

> The proxy error that you're getting doesn't sound like it has anything to do
> with your program.  It sounds like you're not able to properly connect to 
> their webserver for whatever reason.
> 

For what its worth it works fine for me.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sun, 15 Apr 2001 10:45:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Flame Target
Message-Id: <svuidt41fjh0epejhj94a38dee7b6lm2jj@4ax.com>

brian d foy wrote:

>> print <<END;
>> 
>> Content-Type: text/html\n\n
>
>what's that extra line doing there?

In laymen's terms: no blank line in front of that header line, please.


-- 
	Bart.


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

Date: Sun, 15 Apr 2001 14:57:03 +0200
From: Albert Keizer <atkeizer@lucent.com>
Subject: Re: Flame Target
Message-Id: <3AD99A9F.77C6A244@lucent.com>

"Joseph Andr=E9" wrote:
> =

> I don't know, I was told to put it there. Is that the cause of my probl=
em?
Don't worry it should be there but on the first line and followed by an
empty line
(twice \n) not 6 as you did.
Then your server expects something like: =

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
after this you print your contents.
> =

> --
> Your basis everything belongs to me, it is! I am the Zoltan of for the =
sake
> of! Huzzah!
> -Joe
> =

> "brian d foy" <comdog@panix.com> wrote in message
> news:comdog-3166A2.00091015042001@news.panix.com...
> > In article <9bb38j$8jbaf$1@ID-50051.news.dfncis.de>, "Joseph Andr=E9"=

> > <msoftmonkeySPAM@crosswinds.net> wrote:
> >
> > > print <<END;
> > >
> > > Content-Type: text/html\n\n
> >
> > what's that extra line doing there?
> >
> > --
> > brian d foy <comdog@panix.com>
> >

To make a long story short look at:
http://www.perl.com/pub/qa/How_can_I_learn_to_write_CGI_scripts?

Albert


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

Date: Sun, 15 Apr 2001 10:47:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Graphics in windows??
Message-Id: <84vidt0dnvbvu63u7l47rl8muum5usvsfq@4ax.com>

Joe Morris wrote:

>I installed the GD module at home on my 
>Windows 98 box and pasted in a generic graphics script (I think it drew a 
>line, or tried to) and tried to run it from the command line in the dos box. 
>It did not draw a line, and did not output an error, but instead just 
>printed 
>a bunch of noise characters.

You should save this to a file, instead of printing it to the output.
And don't forget to binmode your file handle.

-- 
	Bart.


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

Date: Sun, 15 Apr 2001 05:10:37 GMT
From: Jeffrey Hobbs <JeffH@ActiveState.com>
Subject: Re: Is a function/class library for processing of SMTP-mails available?
Message-Id: <3AD92D55.F5378395@ActiveState.com>

Markus Elfring wrote:
> 
> I've found the following:
> > man forward
> " ...
>      If the first character of the address is a vertical bar (|),
>      sendmail(1M)  pipes the message to the standard input of the
>      command the bar precedes.
> ... "
> 
> I want to read this piped message to import it in one of our systems after
> the sender and the subject had been checked.
> Do you know a function or class library for a programming language (e. g.
> PHP, TCL or Perl) that helps me to process this mail?

Well, you just pipe it to the program, and it does what it needs
on stdin.  What you'll need are mime tools for parsing the mail,
and perhaps to do more mail stuff with it, which can be had at
http://www.cpan.org/ for Perl and at http://tcllib.sourceforge.net/
for Tcl.

-- 
  Jeff Hobbs                     The Tcl Guy
  Senior Developer               http://www.ActiveState.com/


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

Date: 15 Apr 2001 10:40:56 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: need help cgi/perl/form variables
Message-Id: <9bbtro$cmk$1@uranium.btinternet.com>

Sigi <sigi@mail2me.de> wrote:
> 
> Hello
> 
> I have a problem with an cgi perl script.
> 

What you have is a problem with implementing a CGI program in your
choice of environment - this has no Perl content as far as I can see.
You will almost certainly be better off asking this question in the
newsgroup comp.infosystems.www.authoring.cgi

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: 15 Apr 2001 09:59:39 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: New NG member - seeks a little help :)
Message-Id: <9bbreb$7vb$2@neptunium.btinternet.com>

Robb Meade <robbie@dontgoofymousespam.freeserve.co.uk> wrote:
> Nope - its beaten me :(
> 
> Keep getting this, with what ever variation I try....
> 
> Could not open /cgi-bin/mailing/email.txt: No such file or directory at
> /home/goofymouse/cgi-bin/mailing/mailing.cgi line 15.
> 

The second half of the error message should indicate where your problem
lies - it is telling you the complete path to your cgi-bin directory
which is what you should be using to access your file. IE :

   /home/goofymouse/cgi-bin/mailing/email.txt

The paths that you get wrt to the http server are not the same as the
filesystem paths on the whole.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Sat, 14 Apr 2001 12:09:42 +0200
From: "biG" <ofirb1@netvision.net.il>
Subject: OT(?): SSI vs. Non-SSI
Message-Id: <9b946l$6rg$1@news.netvision.net.il>

Hi all,
What is the difference(s) between SSI and Non-SSI scripts, from the Perl/CGI
point of view?

If I want to write one SSI script, and the same script for Non-SSI, how do I
do it?
I want a VERY simple script, to print some lines on an HTML page.

Thanks in advance,
Ofir


We don't stop playing because we grow old, we grow old because we stop
playing.





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

Date: Sun, 15 Apr 2001 10:45:22 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: OT(?): SSI vs. Non-SSI
Message-Id: <Pine.LNX.4.30.0104151038150.3458-100000@lxplus003.cern.ch>

On Sat, 14 Apr 2001, biG wrote:

> What is the difference(s) between SSI and Non-SSI scripts, from the Perl/CGI
> point of view?

Ill-defined question.  The one's presumably invoked by one of the
various server-defined interfaces for server-side include (they aren't
standardised), whereas the other isn't.

What is it you really want to know?  Consult your server's
documentation to find out what SSI mechanisms it supports.

> If I want to write one SSI script, and the same script for Non-SSI, how do I
> do it?

The question is still impossibly vague.  What do you want to achieve?

An SSI script typically returns some document snippet that makes sense
in the context in which it's invoked.  A CGI script must return a
valid CGI response, which might include a complete document body.

> I want a VERY simple script, to print some lines on an HTML page.

Don't they all?  But this isn't a Perl language question.
Followup group suggested.




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

Date: Sat, 14 Apr 2001 23:54:40 -0700
From: "Preston Price" <pric3596@cs.uidaho.edu>
Subject: Premature end of script headers?
Message-Id: <9bbgd7$fcu$1@kestrel.csrv.uidaho.edu>

I have this really easy script that looks like this:
#!/usr/local/bin/perl

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

print header;
print start_html('upload test');
my $filename = param('file_name');
print qq ($filename);

I dont know why I am getting this error:
got any ideas?
Thanks!




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

Date: 15 Apr 2001 03:08:15 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Premature end of script headers?
Message-Id: <m3wv8m1vz4.fsf@mumonkan.sunstarsys.com>

"Preston Price" <pric3596@cs.uidaho.edu> writes:

> I have this really easy script that looks like this:
> #!/usr/local/bin/perl
   ^^^^^^^^^^^^^^^^^^^^
Where is your server's perl binary installed?
What do the server's error logs say?

It appears that the syntax of your script is OK-
did you try debugging it from the command line?

For more help, see

http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html

-- 
Joe Schaefer       Then the King smiled.  "A hard day," he'd say, "full of
                nizzardly worries.  A long day," he'd say. "Now it's time for
                                          some fun!"
                                               -- Dr. Seuss


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

Date: Sun, 15 Apr 2001 12:45:05 +0200
From: "Christer Holmdahl" <chho@privat.utfors.se>
Subject: SV: perl equivalent for (char) long_var in C ?
Message-Id: <9bbu45$g8d$1@yggdrasil.utfors.se>

I've been tracing the code and it seems that
(pack("c",$key2) * pack("c",($i+$key1)))
doesn't work the same way
((char)key2 * (char)(i+key1))
does in C.

Perl returns 0, C returns a character.

Can anyone explain this?

/Christer







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

Date: Sun, 15 Apr 2001 11:33:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: SV: perl equivalent for (char) long_var in C ?
Message-Id: <ai1jdto0hr2md3t762ehos09dbsheaukss@4ax.com>

Christer Holmdahl wrote:

>I've been tracing the code and it seems that
>(pack("c",$key2) * pack("c",($i+$key1)))
>doesn't work the same way
>((char)key2 * (char)(i+key1))
>does in C.

That's because a char in C is a number, in Perl, it's a string. C
doesn't know strings.

Perhaps you want

	substr($buf, $i, 1) = chr(ord(substr($buf, $i, 1)) ^
	  ($key2 * ($i+$key1)) & $and_f);

But note that

	@ary = unpack('C*', $string)

returns an array of character codes (numbers), and

	$str = pack 'C*', @ary;

makes a string of it, again.

-- 
	Bart.


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

Date: Sun, 15 Apr 2001 11:42:44 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: SV: perl equivalent for (char) long_var in C ?
Message-Id: <3ad97eda.85787424@news.erols.com>

On Sun, 15 Apr 2001 12:45:05 +0200, "Christer Holmdahl"
<chho@privat.utfors.se> wrote:

>I've been tracing the code and it seems that
>(pack("c",$key2) * pack("c",($i+$key1)))
>doesn't work the same way
>((char)key2 * (char)(i+key1))
>does in C.

Perl is not C.  To steal a line from one the giants, you will be
miserable until you understand this.

You're struggling to find a way to cast variables where casting is not
necessary.  Perform your math function on the scalars themselves, and
trust perl to do the Right Thing.

  $result = $key2 * ($i + $key1);

If you're really bent on having a character representation of the
result, then use pack.  You will need to unpack it before performing
any more computations.

>Perl returns 0, C returns a character.

If you had warnings enabled, perl would have dropped a hint by
complaining about an attempt to use non-numeric arguments in
multiplication.


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

Date: 15 Apr 2001 11:10:21 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: to get a PId
Message-Id: <987332624.20922@itz.pp.sci.fi>

In article <h22C6.442$yP4.892013@nnrp6.proxad.net>, guillaume wrote:
>Ilmari Karonen a écrit:
 [further attribution lost]
>>>how can i get the PId of any application? i didn't find a PERL function
>>>to do that. (i don't speak of the PERL program's PId)
>>
>>  http://search.cpan.org/search?dist=Proc-ProcessTable
>
>thank you, but i'm under Win32.

Okay, in that case a quick search turns up:

  http://search.cpan.org/search?dist=Win32-API
  http://msdn.microsoft.com/library/psdk/winbase/psapi_5kqb.htm

Not quite as simple, but that ought to do it, I guess.  If you get it
working, maybe you could wrap the code in a module, call it something
like Win32::ProcessTable, and put it on CPAN to save everyone else the
trouble.

[Crossposted to comp.lang.perl.modules, followups there please.]

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.


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

Date: 15 Apr 2001 01:08:19 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: why i posted
Message-Id: <9bbdsj$c0p$1@charity.cs.utexas.edu>

In article <3ad90331$0$58093$45beb828@newscene.com>,
sdfsd <sdfes@dsf.com> wrote:
>I asked not because i wanted somebody to write the program for me.  We have 
>already done it in C (not C++, since we dont have the expertise)

Well, C would be perfectly adequate for this task.  The reason I
suggested C++ when I did is that C++ has the standard template library,
which can does lots of the data structures work for you.  That would
make the task of eliminating duplicates easier.

>I was not asking for a written problem but basically  
>1 - can perl do this
>2-  if so give can u give a basic outline so we can expend on it and test it 
>out

Ah, I see.  In this group, generally people come along with two
types of questions.  Either it's

(1)  "I have been working on this script for a while, and I just can't
      understand why the blah blah blah does blah in the context of
      blah.  I tried using blah, but it doesn't work and I get
      this error message blah."

or

(2)  "I am trying to write a program to like, print some data you know,
      and it doesn't work.  It doesn't work.  It prints some kind of
      error message, but I can't remember what.  Can anybody fix it
      for me, because I'm really confused."

That is, we either get people who want help understanding specific
technical questions, or we get people who want people to do their
programming for them for free.  Needless to say, #2 isn't very
popular.  Less obviously, #1 is not only the kind of question
programmers like to answer but also the type of question they expect
people to be asking, because that's the kind of question they would
themselves ask.

Aaaaanyway, generally speaking, Perl could be good for the type of
thing you're talking about.  It's going to be faster and more flexible
than some things, but it's not going to be as fast as C or C++.

Mostly the big virtues of Perl are that it is flexible and that it is
easy to develop solutions to this kind of problem quickly.  They may
not run as fast as possible, but at least you can get something
working, and if you find it's too slow, then you can rewrite it in C or
whatever.  You may find that for some purposes, it's fast enough and
you don't have to.

>I am sorry the spec was so poor but i though question was clear baically 
>dealing with duplicate data.  a field appears twice or more in a line what i 
>want is to group it together.  i was a bit supprised that people were asking 
>about delimiters and such since i took that as a non issue.

Well, I think that was just because people didn't know *what* part of
the problem you were trying to solve.  One thing Perl is good for is
manipulating text, and so if you say "I've got a file I need to read in
and the format is basically like this", then people are going to
naturally think that the problem you want to solve is reading the file
format.

Actually, eliminating duplicates like you mentioned is really pretty
easy in Perl.  You just use an associative array, which is basically
like a regular array except the index can be a string instead of an
integer.  (Actually, awk has this feature too...)

Another feature Perl has that you may find useful is that there is a
package called DBI that makes database access pretty easy.  So, if you
were reading these files and then creating output files that you were
going to import into a database, with Perl you could just write it so
that it reads the input files and puts the information straight into
the database.

Hope that helps.

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


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

Date: 15 Apr 2001 10:10:59 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: why i posted
Message-Id: <9bbs3j$7vb$3@neptunium.btinternet.com>

Eric Bohlman <ebohlman@omsdev.com> wrote:
> sdfsd <sdfes@dsf.com> wrote:
>> I am sorry the spec was so poor but i though question was clear baically 
>> dealing with duplicate data.  a field appears twice or more in a line what i 
>> want is to group it together.  i was a bit supprised that people were asking 
>> about delimiters and such since i took that as a non issue.  but that is 
>> probably due to my poor knowledge of perl
> 
> 
> Data formats are one of those areas where, quite annoyingly, everyone 
> comes up with their own personal notation conventions that seem perfectly 
> obvious to them but that nobody else can comprehend
> 

Perhaps people ought to take a look at :

http://www.cs.uofs.edu/~mccloske/courses/cmps340/lecture_notes/cobol_data_div.html

And use this well tried and tested method of describing their data :)

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 702
**************************************


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