[16490] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3902 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 3 14:10:30 2000

Date: Thu, 3 Aug 2000 11:10:19 -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: <965326218-v9-i3902@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 3 Aug 2000     Volume: 9 Number: 3902

Today's topics:
    Re: Newbie help with loops, last, split (Greg Bacon)
    Re: Newbie help with loops, last, split <red_orc@my-deja.com>
    Re: Newbie help with loops, last, split <mauldin@netstorm.net>
    Re: Newbie help with loops, last, split <stephen.kloder@gtri.gatech.edu>
    Re: Open FILEs <tim@ipac.caltech.edu>
    Re: pattern matching across two lines <aqumsieh@hyperchip.com>
    Re: pattern matching across two lines <lr@hpl.hp.com>
    Re: pattern matching across two lines <lr@hpl.hp.com>
        Perl and mSQL Database <blacking@tin.it>
        Permissions Denied errors <Daniel.Hu@dartmouth.edu>
    Re: Permissions Denied errors <care227@attglobal.net>
    Re: Problems with reserved word in Net::SMTP copyright  <gellyfish@gellyfish.com>
    Re: Queastion about CGI.pm sticky values <rschram@reed.edu>
    Re: Removing all HTML tags from a String <Sasa.Danicic@eurodyn.com>
        Retrieving BLOBs from Oracle using DBI boggsy@my-deja.com
    Re: returning an array <aqumsieh@hyperchip.com>
    Re: returning an array <ab@cd.com>
        Select BLOB In Oracle with DBI <e.schmitz@mediacare.de>
        Send Data Received to another Server ???? hugo.b@derivs.com
        SendMail.pm bing-du@tamu.edu
        split strings by number oderus54@my-deja.com
    Re: split strings by number <care227@attglobal.net>
    Re: split strings by number (Anno Siegel)
    Re: split strings by number <tony_curtis32@yahoo.com>
    Re: Upload File??? <samara_biz@hotmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 03 Aug 2000 15:21:12 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Newbie help with loops, last, split
Message-Id: <soj3f884dbm149@corp.supernews.com>

In article <39898456.B73660C4@charlotte.infi.net>,
    Gary Nielson  <gnielson@charlotte.infi.net> wrote:

: I am having trouble how to grab the contents of a text file up until the
: first "<p>" and then exit the operation and am needing some advice on
: how to approach this.

    my $contents = '';

    open FILE, $file or die "$0: open $file: $!";

    while (<FILE>) {
        if (1 .. /<p>/i) {
            $contents .= $_;
        }
        else {
            last;
        }
    }

    close FILE;

Greg
-- 
Are you suggesting that Y2K could interrupt Beer production, ye gods, it's
worse than I thought! Surely they got the breweries in the first pass along
with other critical systems like nuclear power stations.
    -- Nik Simpson


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

Date: Thu, 03 Aug 2000 16:28:07 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Newbie help with loops, last, split
Message-Id: <8mc6if$6f$1@nnrp1.deja.com>

In article <39898456.B73660C4@charlotte.infi.net>,
  Gary Nielson <gnielson@charlotte.infi.net> wrote:
> I tried splitting an array by <p> but split does not take but
> one character, right?

perldoc -f split

split actually can take a pattern, which can be more than one character


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


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

Date: Thu, 03 Aug 2000 16:53:25 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Newbie help with loops, last, split
Message-Id: <3989A307.CD775B88@netstorm.net>

Greg Bacon wrote:
> 
> In article <39898456.B73660C4@charlotte.infi.net>,
>     Gary Nielson  <gnielson@charlotte.infi.net> wrote:
> 
> : I am having trouble how to grab the contents of a text file up until the
> : first "<p>" and then exit the operation and am needing some advice on
> : how to approach this.
> 
>     my $contents = '';
> 
>     open FILE, $file or die "$0: open $file: $!";
> 
>     while (<FILE>) {
>         if (1 .. /<p>/i) {
>             $contents .= $_;
>         }
>         else {
>             last;
>         }
>     }
> 
>     close FILE;
> 

Very smart!  I am truly impressed ... I had never seen this before.  But
to get exactly what the poster wants ("up until" <p>) I guess you'd have
to add:

$contents =~ s/<p>.*$//s;

-- Jim


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

Date: Thu, 03 Aug 2000 13:57:35 -0400
From: Stephen Kloder <stephen.kloder@gtri.gatech.edu>
Subject: Re: Newbie help with loops, last, split
Message-Id: <3989B28F.FE073E3A@gtri.gatech.edu>

Gary Nielson wrote:

> I am having trouble how to grab the contents of a text file up until the
> first "<p>" and then exit the operation and am needing some advice on
> how to approach this. I basically want to inhale a file until it hits
> the first <p> and then exit. Whatever I am attempting isn't working. For
> example, I tried splitting an array by <p> but split does not take but
> one character, right? I tried using a loop with until, and I have tried
> using last -- but not only am I having trouble getting this to work, but
> there is more work with this approach because if "<p>" is in the middle
> of a line, I would want to get everything up to and including the <p>
> and nothing more. Any advice on how to best approach this appreciated.
> Please email reply as well.
>

open FILE,$fname or die "Can't open $fname: $!";
$/='<p>';
$result = scalar <FILE>;
close FILE or die "Can't close $fname: $!";

Of course, this assumes there is no <P> to precede the first <p>.
perldoc perlvar




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

Date: Thu, 03 Aug 2000 10:48:10 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Open FILEs
Message-Id: <3989B05A.68154ADF@ipac.caltech.edu>

Howard wrote:
> 
> #a.pl
> open(LOG, ">log.dat");
> `perl b.pl`;
> print LOG "something wrong in master script\n";
> close LOG;
> 
> but in b.pl code, I also want to print something into LOG file. Can I use the
> same filehandler LOG? even if I use another FILE HANDLER to open the same
> file,
> 
> #b.pl
> open(LOG2, ">log.dat");
> print LOG2 "something wrong in b.pl\n";
> close LOG2;

Tina's solution elsewhere is the simplest fix, but if you can't 'do
"b.pl"' for some reason (e.g. a.pl and b.pl need to run as independant
processes), then you need to know what's wrong with the code above. It's
not a buffering issue, it's that both a.pl and b.pl open the file to
overwrite, and since a.pl writes last, it wins. Here's the sequence of
events (roughly):

1 - a.pl opens log.dat. the write pointer associated with LOG is set to
the top of the file.
2 - b.pl opens log.dat and writes it's message (into a buffer) and
closes the file (flushing the buffers) and setting the EOF to the end of
the message.
3 - a.pl (with its write pointer still at the top of the file) writes
its message (to a buffer).
4 - a.pl exits and flushes buffers and sets the EOF to the end of a.pl's
message (overwriting b.pl's message).

Having independant processes writing to the same file is tricky. If you
need to do this, check the perlfaq5 doc for 'How do I lock a file?", and
read up on 'select' and 'seek'.

- 

--

-- Tim Conrow         tim@ipac.caltech.edu       626-395-8435


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

Date: Thu, 03 Aug 2000 15:38:24 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: pattern matching across two lines
Message-Id: <7ad7jqfj82.fsf@merlin.hyperchip.com>


Rich More <rmore1@my-deja.com> writes:

> open(FH,$ARGV[0]);

It's better to check and see whether the open succeeded or not ..

> local($/);

why do you localize $_ when you don't use it?

> $str=<FH>;
> close(FH);
> 
> $str =~ s/foo\r\nbar/foobar/gsm;

Hmmm .. the /s modifier affects the behaviour of the dor '.' inside a
regexp making it match newlines. And the /m modifier affects the
behaviour of '^' and '$' making them match within a string.

You don't have a '.', '^' or '$' in your regexp, so why are you using
/sm?

--Ala


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

Date: Thu, 3 Aug 2000 10:46:58 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pattern matching across two lines
Message-Id: <MPG.13f34fef427028da98ac2e@nntp.hpl.hp.com>

In article <398927E7.664697B2@gredos.cnb.uam.es> on Thu, 03 Aug 2000 
10:05:59 +0200, Federico Abascal <fabascal@gredos.cnb.uam.es> says...
> Nitin wrote:
> 
> > How can I match patterns across two lines?
> 
> Hello, the simplest way I see is:
> while(<>) {
>     if(/patternA/) {
>         $_ = <>;
>         if(/patternB/) {
>              #You have detected the pattern accross two lines
>         }
>     }
> }
> 
> I hope this helps,

Well, no, because in your code $_ still contains one line -- the second 
one read.  To match /patternB/ across two lines, you must concatenate, 
not assign, to $_.

          $_ .= <>;

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


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

Date: Thu, 3 Aug 2000 10:56:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pattern matching across two lines
Message-Id: <MPG.13f352136aa7e6da98ac2f@nntp.hpl.hp.com>

In article <7ad7jqfj82.fsf@merlin.hyperchip.com> on Thu, 03 Aug 2000 
15:38:24 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> says...
> 
> Rich More <rmore1@my-deja.com> writes:

 ...

> > local($/);
> 
> why do you localize $_ when you don't use it?

That is $/, not $_.  The proper localization is in a block, though, so 
it doesn't affect the rest of the program.

> > $str=<FH>;
> > close(FH);
> > 
> > $str =~ s/foo\r\nbar/foobar/gsm;
> 
> Hmmm .. the /s modifier affects the behaviour of the dor '.' inside a
> regexp making it match newlines. And the /m modifier affects the
> behaviour of '^' and '$' making them match within a string.
> 
> You don't have a '.', '^' or '$' in your regexp, so why are you using
> /sm?

Furthermore, the internal representation of newline is the single 
character "\n", not the two characters "\r\n", even on systems where 
"\r\n" is the external representation.  (Excepting the use of binmode(), 
of course, which would be wrong here.)

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


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

Date: Thu, 3 Aug 2000 16:43:33 +0200
From: "Roberto Gnerre" <blacking@tin.it>
Subject: Perl and mSQL Database
Message-Id: <8mc0rg$gcu$1@nslave2.tin.it>

Hello everybody,
I really need your help.
I have to query a mSQL database using a Perl script but I can't connect to
the database from the Perl script.
It always display this error message:

Config Error : unknown section 'general' or element 'db_dir' at line 21.

I coded my Perl script as follow
 ............................................................................
 ..........................
#!/usr/local/bin/perl

use Msql;

$dbh = Msql->connect;
$dbh->selectdb("nomedatabase");
 ............................................................................
 ...........................

Thank to all for your support.
Bye.

Roberto Gnerre






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

Date: Thu, 03 Aug 2000 12:10:12 -0400
From: "Dan Hu" <Daniel.Hu@dartmouth.edu>
Subject: Permissions Denied errors
Message-Id: <8mc232$6hm$1@merrimack.Dartmouth.EDU>

Hello,

I am writing scripts that would allow me to create and delete files to my
web account via any browser. I am getting Permission Denied errors when I
try to call an open command. Also, unlink doesn't seem to be deleting an
files.

I have found that if i chmod 777 the target directories, all is well. But
this is a highly insecure solution.

I'm hoping that there's a way to give scripts "permissions" for such
operations, but am clueless as to how to do it. Any help is much
appreciated.

Take care,
Dan


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

Date: Thu, 03 Aug 2000 12:10:42 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Permissions Denied errors
Message-Id: <39899982.63D24D1F@attglobal.net>

Dan Hu wrote:
> 
> Hello,
> 
> I am writing scripts that would allow me to create and delete files to my
> web account via any browser. I am getting Permission Denied errors when I
> try to call an open command. Also, unlink doesn't seem to be deleting an
> files.
> 
> I have found that if i chmod 777 the target directories, all is well. But
> this is a highly insecure solution.

Well, thats a clue.  Your script is executing under the UID of the 
webserver process.  Since this has nothing to do with Perl, you'll be
best suited to asking about this in a more general newsgroup, perhaps
comp.unix.*


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

Date: Thu, 03 Aug 2000 16:12:49 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problems with reserved word in Net::SMTP copyright information
Message-Id: <5Sgi5.984$82.58611@news.dircon.co.uk>

On Thu, 03 Aug 2000 10:10:02 -0400, Drew Simonis Wrote:
> Drew Simonis wrote:
>> 
>> # Copyright (c) 1995-1997 Graham Barr <gbarr@pobox.com>. All rights
>> reserved.
> 
> This wrap was the fault of my post, it is all one line in the module.

This could well be what has happened to the OP who has cut and paste it
 ...

/J\


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

Date: Thu, 03 Aug 2000 10:51:35 -0700
From: RS@ <rschram@reed.edu>
Subject: Re: Queastion about CGI.pm sticky values
Message-Id: <196f6438.04036af4@usw-ex0102-014.remarq.com>


But why does it happen? I am new to CGI.pm, and Perl, and
recently encountered the very same problem.

Can anyone recommend a discussion of this kind of relationship
between methods in CGI? (Perhaps such would be a big 'ol book
called "Introduction to Objects"...)


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

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



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

Date: Thu, 03 Aug 2000 18:36:16 +0300
From: Sasa Danicic <Sasa.Danicic@eurodyn.com>
Subject: Re: Removing all HTML tags from a String
Message-Id: <39899170.AD2D2794@eurodyn.com>

Do I understend you well:

so, you and I have something like this:

<F1> <F2>ddd</F2> <F3>eee</F3> <F4>xxyyyzz</F4> <F5>

So I want to extract in string, values ddd, eee and xxyyyzz ;-))

Well, how to to this?

Sasa




> 
> I found this on the FAQ at www.cpan.org
> 
>                 s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
> 
> Don't know if it works yet ... I gonna try to strip all that XML garbage
> that USPS sends back.  eg. xml snippit <Zone>8</Zone>
> 
>         $ret[7] =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
>         $Zone = $ret[7];
>         $ret[8] =~s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
>         $Postage = $ret[8];
> 
> Hopefully, I'll end up with a zone number and a postage amount when the
> packaging is stripped away.  Worth a shot.
> 
> Have Fun!
> 
> Jon
> 
> 43% of all statistics are made up on the spot.


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

Date: Thu, 03 Aug 2000 16:19:16 GMT
From: boggsy@my-deja.com
Subject: Retrieving BLOBs from Oracle using DBI
Message-Id: <8mc61t$vmk$1@nnrp1.deja.com>

I'm having trouble fetching a BLOB value in Oracle using DBI.   The
following code does not go into the fetch loop....when I select a BLOB
column.  Any other column and it works fine.


	$stmt = $db->prepare("select blob_fld from sometable where key
= 101") || die "\nPrepare error: $DBI::err .... $DBI::errstr\n";

	$stmt->execute() || die "\nExecute error: $DBI::err ....
$DBI::errstr\n";

	$row = 0;
	while ($blob = $stmt->fetchrow)
	{

		printf STDERR "Fetching row %d \n", $row++;
		print STDOUT $blob;
	}

	$stmt->finish();

	if (!$row)
	{
		print STDERR "No data found.\n";
	}
	else
	{
		print STDERR "Complete.\n";
	}

--
Ron Boggs
Trade Harbor, Inc.
St. Louis, MO


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


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

Date: Thu, 03 Aug 2000 15:42:32 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: returning an array
Message-Id: <7aaeeufj11.fsf@merlin.hyperchip.com>


Nitin <muhala@my-deja.com> writes:
> In article <JW5i5.4588$0W4.156550@newsread2.prod.itd.earthlink.net>,
>   "Blair Heuer" <ab@cd.com> wrote:
> > A script I am writing uses a database to handle all data and to
> > simplify coding, I decided to use a function for getting the data to
> > save on space and readability. The problem is, when I get the data
> > it is returned in an array of hashes, but I can't figure out how
> > to return an array. Using: <code> return @return; </code> only
> > returns the number of elements in the array.

It depends on the context of your call to the subroutine. If you assign
the value back to a scalar, then you get the number of elements in the
returned array. If you assign the value back to an array, then you
should get the whole array.

> > Also, would returning a hash follow the same methods.

Yes.

> try return (@return);

Bad advice. Please don't post answers you haven't tested as it might
confuse others more than help them.

--Ala



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

Date: Thu, 03 Aug 2000 18:00:14 GMT
From: "Blair Heuer" <ab@cd.com>
Subject: Re: returning an array
Message-Id: <Oqii5.6487$0W4.211008@newsread2.prod.itd.earthlink.net>

> an array can have two values depending on whether it is evaluated in
> LIST or SCALAR context .. forget the subroutine stuff because it has
> nothing to do with that .. the subroutine is correctly returning the
> array .. but then the array is being evaluated in three different
> contexts

That was exactly my problem. Returning an array to a scalar was setting the
scalar to the number of elements in the array. With fixing up of the
subroutine to return the type of variable that would be expected by the
input, I was able to get it to work.

Thanks!
-Blair




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

Date: Thu, 3 Aug 2000 17:04:39 +0200
From: "Erik Schmitz" <e.schmitz@mediacare.de>
Subject: Select BLOB In Oracle with DBI
Message-Id: <8mc1pc$668oq$1@ID-33693.news.cis.dfn.de>

Hi!

I`m having problems getting a BLOB out of an Oracle 8.0.5 DB.
I am using DBI 1.1.4 with DBD-Oracle 1.03 running with
ActivePerl 613 on Windows NT4.

This is the table named previews:
 Name                             Null?    Type
 -------------------------------- -------- --------------
 ID                               NOT NULL NUMBER
 PREVIEW                                   BLOB
 QUARK                                     VARCHAR2(512)

When I try the following code...

use DBI;
use DBD::Oracle qw(:ora_types);

$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passwd,
    {RaiseError => 1,AutoCommit => 0,LongTruncOk => 1})
       or die "Couldn't connect to database: " . DBI->errstr;

$sth = $dbh->prepare(qq{select preview from previews where id=13299});
$sth->{LongReadLen} = 40000;
$sth->execute();
my $row = $sth->fetchrow_hashref;
$sth->finish();
$dbh->disconnect();

 ... I only get this error:

DBD::Oracle:st execute failed: ORA-00932: inconsistent datatypes
(DBD: oexfet error) at .... line xx

where line xx ist the $sth->execute().

Could anybody give me a hint?





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

Date: Thu, 03 Aug 2000 16:29:30 GMT
From: hugo.b@derivs.com
Subject: Send Data Received to another Server ????
Message-Id: <8mc6l1$82$1@nnrp1.deja.com>

How do I send data received from html form to another server using PERL
???

Any Help

hugo.b@derivs.com

Thanks

Hugo


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


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

Date: Thu, 03 Aug 2000 17:48:27 GMT
From: bing-du@tamu.edu
Subject: SendMail.pm
Message-Id: <8mcb99$47o$1@nnrp1.deja.com>

Hello there,

Has any body have used SendMail.pm?

I have the following problem with SendMail.pm.

I need to send 100 students some email notice.   My Perl script creates
an array '@to' which contains 100 students' email addresses.  But if I
used $sm->To(@to) to send notice, then when each student reads the
notice, he/she will first have to see 100 students' email addresses
listed in TO field in the message header.  It's ugly.

I want the notice to be sent to all students at the same time but for
each student, he/she just sees his/her own email address listed in TO
field.

Then I changed the script as below.  The basic idea was I expected to
loop through array @to to send each student notice with only one
recipient address showed up in TO failed.  Unfortunately, this method
did not accomplish what I wanted.  Instead, each student got the
following headers respectively:

student1 got three same notices with different TO field:
           TO: r1@some.edu
           TO: r1@some.edu, r2@some.edu
           TO: r1@some.edu, r2@some.edu, r3@some.edu

student2 got two same notices with different TO field:
           TO: r1@some.edu
           TO: r1@some.edu, r2@some.edu

 ...

student100 got one notices with all 100 students' address listed in TO
like this:
          TO: r1@some.edu, r2@some.edu,...  r100@some.edu

I can not figure out why the following script would generate the above
result?

=====================================
@to = ("r1@some.edu","r2@some.edu",..."r100@some.edu");

foreach $to (@to)
  {

    $sm->From($from);

   $sm->To($to);

    $sm->Cc($cc);
    $sm->ReplyTo($replyto);
    $sm->Subject($subject);

    foreach $item (keys %specific_session)
    {
     if ($item =~ /^$uid\_attach\_(.*)/)
     {
        $sm->Attach("$tmp/$item");
     }
    }

    $mailbody = <<__END__MAILBODY__;

    $memo

__END__MAILBODY__

    $sm->setMailBody($mailbody);

    if ($sm->sendMail() != 0) {
       print $sm->{'error'}."<br>";
       exit;
    }
  $to = '';
  } # end of foreach $to (@to)
======================================

Thanks for listening.  I have been struggling with this problem for some
time.  And at my wit's end :(.

Any ideas and suggestions would be greatly appreciated.

Bing


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


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

Date: Thu, 03 Aug 2000 15:59:04 GMT
From: oderus54@my-deja.com
Subject: split strings by number
Message-Id: <8mc4s5$umh$1@nnrp1.deja.com>

How would i split strings by number, like for example;


$blah = "abcdefghijklmn";
#now i want $string1 = "abc", $string2 = "defgh", $string3 = "ijk",
$string4 = "lmn"

Thanks in advance


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


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

Date: Thu, 03 Aug 2000 12:11:08 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: split strings by number
Message-Id: <3989999C.3509CD81@attglobal.net>

oderus54@my-deja.com wrote:
> 
> How would i split strings by number, like for example;
> 
> $blah = "abcdefghijklmn";
> #now i want $string1 = "abc", $string2 = "defgh", $string3 = "ijk",
> $string4 = "lmn"
> 
> Thanks in advance
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

perldoc -f substr


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

Date: 3 Aug 2000 16:16:18 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: split strings by number
Message-Id: <8mc5si$l0v$1@lublin.zrz.tu-berlin.de>

 <oderus54@my-deja.com> wrote in comp.lang.perl.misc:
>How would i split strings by number, like for example;
>
>
>$blah = "abcdefghijklmn";
>#now i want $string1 = "abc", $string2 = "defgh", $string3 = "ijk",
>$string4 = "lmn"

While the description you give is less than clear, it looks like
you want to split a string at given character positions.  If so,
the substr function is what you are looking for. perldoc -f substr.

As usual, there are more ways to do this.  If you're really into
fun, try unpack.

Anno


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

Date: 03 Aug 2000 11:27:36 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: split strings by number
Message-Id: <87snsm71jb.fsf@limey.hpcc.uh.edu>

>> On Thu, 03 Aug 2000 15:59:04 GMT,
>> oderus54@my-deja.com said:

> How would i split strings by number, like for example;
> $blah = "abcdefghijklmn"; #now i want $string1 = "abc",
> $string2 = "defgh", $string3 = "ijk", $string4 = "lmn"

You're not providing any info about the criteria to be
used for chopping the string up.  3-5-3-3?

It's impossible to answer unless you give more information
about why it's split up like it is above.

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: Thu, 03 Aug 2000 11:38:59 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Upload File???
Message-Id: <39899213.331399D4@hotmail.com>

I briefly explained what happens in my first reply to the original message of
the posting.

Alex

"Ellegiers, J. M. (Jens)" wrote:

> Hi,
>
> "Alex T." wrote:
> >
> > Have you got anything similar to work? If you tried you would see what the
> > problem is.
> >
>
> What happens there?
>
> I have that running ( Perl 5.005_02 ). A form with a file input field, a
> textarea, some text fields and some hidden fields without any problem.
>
> > Alex
> >
> > nobull@mail.com wrote:
> >
> > > Abel Almazan <abel@inlander.es> writes:
> > >
> > > > I need to upload a file and i have a perl that do that, but...
> > > >
> > > > i need to retrieve more information from the form (like description,
> > > > etc..) and i don't know how to get this info.
> > >
> > > I assume you mean this information is entered in other fields in the
> > > same form as contains the file upload field?
> > >
> > > > normallly i use CGI.pm and param('<name of the field>'), but i don't
> > > > hope this work this time.
> > >
> > > Why not?
> > >
> > > --
> > >      \\   ( )
> > >   .  _\\__[oo
> > >  .__/  \\ /\@
> > >  .  l___\\
> > >   # ll  l\\
> > >  ###LL  LL\\
>
> --
> Viele Gruesse, regards, saludos
> Jens Ellegiers
> ---------------------------------------------------------------
> FORD-Werke AG, Spessartstrasse, 50725 Koeln
> Jens Ellegiers                         Email: jellegie@ford.com  /"\
> Engineer (I-Engine CAE)                Phone: +49-221-90-31467   \ /
> Mail Sym: D-ME/PN-S                    Fax  : +49-221-90-33025    X
> ASCII Ribbon campaign against HTML E-mail & Usenet News >------> / \



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

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


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