* SUMMARY : PERL Problem
@ 1997-03-19 9:45 Jean Schuller
0 siblings, 0 replies; 2+ messages in thread
From: Jean Schuller @ 1997-03-19 9:45 UTC (permalink / raw)
To: tru64-unix-managers
Hi all,
Many thanks for all the good and efficient hints .. You're great.
Special thanks to : (WHAT A LIST !!!!!!!!)
Geert Jan Bex=20
Paul A Sand
Dan Peters=20
Dan Rosenthal
Roy Rapoport
Juan Gallego
Lance A. Brown=20
Jean-Loup Risler
John K. Peterson =20
James Michaud
Anthony Talltree=20
Hans Kowallik
Eric Pettersen
Lam Tak Ming
Ben Goodwin
Stavros A. Papadak
Ollivier Robert
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
My problem :
>When I execute my script :
>#!/usr/local/bin/perl
>print "Start of splitting main file\n";
>system("split -100 FINAL.LISTE_SORTED SORTIX.");
>print "Main file splitted\n";
>@list =3D `ls SORTIX* `;
>print "SORTIX List created\n";
>$rank=3D0;
>foreach $li (@list)
>{
> print "I read ",$li," I write ",$outfile,"\n";
> $rank++;
> $outfile=3D"SORTIX".$rank;
> system("mv $li $outfile");
>}
>.
>.
>.
>I have each time an error message :
>Start of splitting main file
>Main file splitted
>List with SORTIXn created
>I read SORTIX.aa
> I write SORTIX1
>usage: mv [-i | f] [--] src target
>.
>.
>.
The solution(s) :
-------------------------------------------------------
use Perl's 'rename' instead?
-------------------------------------------------------
use @list =3D <SORTIX*>;
-------------------------------------------------------
use system(`mv $li $outfile`);
-------------------------------------------------------
Your big problem here is that you have not removed line returns
from your array elements. The way to fix your script is to add
chomp $li;
-------------------------------------------------------
chop $li;
-------------------------------------------------------
ather than doing:
@list =3D `ls SORTIX* `;
I would try
@list=3D<SORTIX*>;
and why not
rename($li,$outfile);
rather than
system(....)
-------------------------------------------------------
$outfile=3D"SORTIX.$rank";
Also, use rename() instead of spawning an mv invocation.
-------------------------------------------------------
JEAN
-------------------------------------------------------------------------=
----
Jean Schuller _/ _/_/_/ _/_/_/ _/_/_/_/
schuller@crnal4.in2p3.fr _/ _/ -/ _/ _/ _/ =20
_/ _/_/_/-/ _/_/_/ _/_/_/_/
_/ _/ -/ _/ _/
_/ _/ _/ _/_/_/ _/_/_/_/ =20
local call: 0388106630 Institut de Recherches Subatomiques
foreign call: (33)388106630 Bo=EEte Postale 28=20
local fax : 0388106234 23, Rue du Loess
foreign fax : (33)388106234 F-67037 STRASBOURG CEDEX - France
-------------------------------------------------------------------------=
----
^ permalink raw reply [flat|nested] 2+ messages in thread
* SUMMARY: Perl problem
@ 2001-04-18 13:12 kat
0 siblings, 0 replies; 2+ messages in thread
From: kat @ 2001-04-18 13:12 UTC (permalink / raw)
To: tru64-unix-managers
Well, thanks to some quick responses, I did a quick test -- moved all the
code from 5.1 system to my old 4.0F machine, and with the same version of
perl (built from source) it worked!
So, summary? I have no clue. I will have to look into it, but there seems
to be something about the Berkeley DB library that no matter what I try on
5.1 fails the open, but on 4.0 it works. I have to go get this system back
up and running, so if/when I find the connection, I will post.
Thanks to those who "tried" the code and it worked. That gave me the idea
to try another version of tru64 (had already tried 2 different 5.1 systems)
cheers
Kat
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-04-18 13:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-19 9:45 SUMMARY : PERL Problem Jean Schuller
-- strict thread matches above, loose matches on Subject: below --
2001-04-18 13:12 SUMMARY: Perl problem kat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox