[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Help!!!!!!



According to kATHY bROOKS:
> 
> Hi I am new to this list,but I am having a small problem.  When you ftp
> your file to your directory how can you get the .pl extension.  I upload in
> text format.  My administrator did something and changed the txt to pl.  I
> tried renaming it and it just added pl to txt.
> For example Hello.pl.txt.  The one he did works fine but mine will not run.
>  Also is their any program on either platform that will let you upload in
> perl.  I have a mac and a PC.
> 

Err..... the following bounced.  So I'm posting it.



> Ok, first when you FTP something it should come to the
> destination machine with the same extension you started
> with.  Next, when you say UPLOADED; do you mean to a Mac or
> to another system?  Like a Unix box.  We need to know what
> _kind_ of a system you are attempting to work with because
> all systems have their own personal quirks.  :-)
>
> Last, but not least, here is a simple Perl program which
> can change filenames for you.  BE CAREFUL how you use it.
> You could wind up wiping out files.
>
> #!perl
>
>   opendir( THEDIR, "theDirectory" );
>   @theList = grep( !/^\.\.?$/, readdir(THEDIR) );
>   closedir( THEDIR );
>
>   for( $i=0; $i<=$#theList; $i++ ){
>       chomp( $theList[$i] );
>       @theName = split( /\./, $theList[$i] );
>       if( $theName[$#theName] =~ /txt/i ){
>           $theName[$#theName] = "pl";
>           $newName = join( "\.", @theName );
>           print "Renaming $theList[$i] to $newName...please wait.\n";
>           rename( $theList[$i], $newName );
>           }
>       }
>
>   print "Finished!\n";
>   exit( 0 );


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch