A question on output of flip flop operator (part 2)

From: justme (mik3l3374_at_gmail.com)
Date: 02/08/05


Date: 8 Feb 2005 07:18:19 -0800

hi

i have a text file with some info like this:

[local]
/home/user
[files]
test1.txt
test1.htm
[dest]
/home/dest
[server]
127.0.0.1
[end]

[local]
/home/user1
[files]
test1.dat
test2.txt
[dest]
/home/dest1
[server]
127.0.0.1
[end]

Actually i am doing an ftp configuration file where the perl sript
will go through this file and pick up the definitions between [local]
and [end]
and then using Net::FTP module to transfer files from local directory
to destination at server defined by [server] until [end] and then
start transferring the next section from [local] to [end]

Am i going the correct way by doing the incomplete code below ? If not
any better way to do that...thanks

while(<FILE>)
{
        if (/\[local\]/ .. /\[files\]/ ) {
                next if ( $_ =~ /\[local\]/ or $_ =~ /\[files\]/ ) ;
                $localdir = $_; #get the line after [local]
        }
        if ( /\[files\]/ .. /\[dest\]/ )
        {
                print "files = $_\n";
                next if ( $_ =~ /\[files\]/ or $_ =~ /\[dest\]/ );
                push(@files, "$_");
        }
        if (/\[dest\]/ .. /\[server\]/ )
        {
               next if ( /\[dest\]/ or $_ =~ /\[server\]/ );
               $dest = $_; #get dest directory to put @files
        }
        
        .....
        ......
}

print "local is $localdir\n";
print "files are = @files\n";
print "dest is = $dest\n";



Relevant Pages

  • Re: A question on output of flip flop operator (part 2)
    ... > Am i going the correct way by doing the incomplete code below? ... Below's a quick example which also builds a little data structure you may ...
    (comp.lang.perl.misc)
  • Re: SQL Server Database Synchronization
    ... The dest db is an exact copy/replica of the source, no updates will be done on the dest db, the dest db should be updated on a daily basis. ... Server A in a Hospital with ISDN connection, server B at ISP, server A is updated on a daily basis by users, server B is readonly for external users, server B needs all data from Server A. ... > Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Missing Rows in Destination Table
    ... Query on the server and it returns the number of row's DTS transfers run it ... else where the missing rows are there, I've check via the GUI and these row's ... "andrewharris" wrote: ... > which aren't in the dest table. ...
    (microsoft.public.sqlserver.dts)
  • Re: Hosting Public DNS
    ... server which will handle all the records for the domain. ... Dest TCP & UDP Port 53, Dest YOUR DNS server address ... source port all FROM Internet ...
    (microsoft.public.windows.server.dns)
  • Re: File transfer through the Internet
    ... click on option settings link, then check the "Enable files or folders to be ... will map drives to her local computer and allow her to transfer files. ... > I think it's the Remote Web Workplace feature I'm looking> for. ... > I have a user that connects to a second server as their> offsite application server running Terminal services, and> it hasn't successfully mapped her printer that is hanging> off her local LPT port on her computer at another> location. ...
    (microsoft.public.windows.server.sbs)