Well seeing as how I am still really new to using perl I have
accomplished what I set out to do and figured I would share it.
The goal, a simple perl script to backup a web directory, compress the
archive and then ftp the file(s) to a remote server.
If anyone knows how to make this more robust,
In Cyberspace -- Jas wrote:
my @files;
find(sub { push @files,$File::Find::name },"/path/to/www/");
Archive::Tar->create_archive("www.tar",0,@files);
Never hard-code your paths...
Eases maintenance later...
# Create Archive from recently created tarball
my $gz = system('gzip -9 www.tar');
Wc -Sx- Jones wrote:
In Cyberspace -- Jas wrote:
my @files;
find(sub { push @files,$File::Find::name },"/path/to/www/");
Archive::Tar->create_archive("www.tar",0,@files);
Never hard-code your paths...
Eases maintenance later...
Can you show me an example of how to do this?
# Create A
Jas wrote:
Wc -Sx- Jones wrote:
In Cyberspace -- Jas wrote:
my @files;
find(sub { push @files,$File::Find::name },"/path/to/www/");
Archive::Tar->create_archive("www.tar",0,@files);
Never hard-code your paths...
Eases maintenance later...
Can you show me an example of how to do this?
Eit
Wc -Sx- Jones wrote:
Jas wrote:
Wc -Sx- Jones wrote:
In Cyberspace -- Jas wrote:
my @files;
find(sub { push @files,$File::Find::name },"/path/to/www/");
Archive::Tar->create_archive("www.tar",0,@files);
Never hard-code your paths...
Eases maintenance later...
Can you show me an e
Jas <[EMAIL PROTECTED]> wrote:
:
: Wc -Sx- Jones wrote:
:
: > In Cyberspace -- Jas wrote:
: >
: > > # Create empty variables
: > > my $year = "";
: > > my $month = "";
: > > my $day = "";
: > > my $c_year = "";
: > > my $c_month = "";
: > > my $c_day = "";
: >
: > Less wordy...
: >
: > my ( $y
Jas wrote:
chomp(my $userid = `/usr/ucb/whoami` || `/usr/bin/whoami` || 'root');
I am not sure what this means? Is this the process ID or the perl
script is running as a root user?
Nope, it is a simple short circuit to see
who the UserID program of the program was;
It states that if I cant tell
Hmmm, I get 3 Indians in only the first variable anyways =/
#! /usr/bin/perl -w
use strict;
# Make -w / use strict; happy...
my ($onelittle,
$twolittle,
$threelittle,
) = 'Indians' x 3;
print "1 $onelittle 2 $twolittle 3 $threelittle\n\n";
__END__
Output -
bash-2.05$ p
WC -Sx- Jones [mailto:[EMAIL PROTECTED]
:
: Hmmm, I get 3 Indians in only the first variable anyways =/
:
:
: #! /usr/bin/perl -w
:
: use strict;
:
: # Make -w / use strict; happy...
: my ($onelittle,
: $twolittle,
: $threelittle,
: ) = 'Indians' x 3;
Ahh! Gra
Charles K. Clarkson wrote:
Make 'Indians' an array.
my( $onelittle,
$twolittle,
$threelittle, ) = ('Indians') x 3;
Create it with a HereDoc =)
-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PRO
20
Please suggest .
Thanks
-Original Message-
From: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 4:44 PM
To: [EMAIL PROTECTED]
Subject: RE: Checking filenames? [:: ?Kinda Solved? ::]
WC -Sx- Jones [mailto:[EMAIL PROTECTED]
:
: Hmmm, I get 3 Indians in only
On Friday 05 March 2004 02:03, Sumit Kaur generously enriched virtual reallity
by making up this one:
> Hi,
Hi,
> I have to write my first Perl script . This scripts Searches for rare =
> codons in nucleotide sequence . The nucleotide sequence is entered by =
> the user in the format "ATTGCAA..
"Charles K. Clarkson" wrote:
>
> WC -Sx- Jones [mailto:[EMAIL PROTECTED]
> :
> : Hmmm, I get 3 Indians in only the first variable anyways =/
> :
> : # Make -w / use strict; happy...
> : my ($onelittle,
> : $twolittle,
> : $threelittle,
> : ) = 'Indians' x 3;
>
> Ahh
Wc -Sx- Jones wrote:
>
> Charles K. Clarkson wrote:
>
> > Make 'Indians' an array.
> >
> > my( $onelittle,
> > $twolittle,
> > $threelittle, ) = ('Indians') x 3;
>
> Create it with a HereDoc =)
Oh, how do you do that?
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-
Wc -Sx- Jones wrote:
>
> Jas wrote:
> >
> >> chomp(my $userid = `/usr/ucb/whoami` || `/usr/bin/whoami` || 'root');
> >
> > I am not sure what this means? Is this the process ID or the perl
> > script is running as a root user?
>
> Nope, it is a simple short circuit to see
> who the UserID progra
John W. Krahn wrote:
chomp(my $userid = `/usr/ucb/whoami` || `/usr/bin/whoami` || 'root');
Why not use $< to find out who you are?
because in the original exercise (OP) I was showing how to greatly
simplify a chain of possible failure and still have a usable outcome.
Maybe root wasnt a great
On Friday 05 March 2004 02:03, Sumit Kaur generously enriched virtual reallity
by making up this one:
> Hi,
Hi,
> I have to write my first Perl script . This scripts Searches for rare =
> codons in nucleotide sequence . The nucleotide sequence is entered by =
> the user in the format "ATTGCAA..
John W. Krahn wrote:
Wc -Sx- Jones wrote:
Charles K. Clarkson wrote:
Make 'Indians' an array.
my( $onelittle,
$twolittle,
$threelittle, ) = ('Indians') x 3;
Create it with a HereDoc =)
Oh, how do you do that?
I guess I made you all wait long enough...
# WARNING - not strict or -w
WC -Sx- Jones wrote:
> Hmmm, I get 3 Indians in only the first variable anyways =/
Doesn't surprise me. The x is a concatentation multiplierfor strings. Why not
just say what you want:
$_ = 'Litttle' for my ($onelittle,
$twolittle,
$threelittle,
) ;
print "1 $onelittl
Sumit Kaur wrote:
Hi,
I have to write my first Perl script . This scripts Searches for rare =
codons in nucleotide sequence . The nucleotide sequence is entered by =
the user in the format "ATTGCAA.." and then the program breaks this =
sequence in the groups of three alphabets like ATT,GCA...so no
20 matches
Mail list logo