Need this $dir variable be replaced by the new one added in windows.

Discussion in 'Perl Misc' started by king, Oct 18, 2007.

  1. king

    king Guest

    #!c:\Perl\bin\perl.exe
    use Strict;
    use File::Copy;
    #use File::find;
    $dir = "2.00.A07";
    print "enter the name of the file to be copied:";
    $file=<>;
    chomp $file;
    $filetobecopied = "//Builds/Prerelease/$dir/$file";

    $newfile = "C:/PERL";
    copy ($filetobecopied,$newfile) or print "file not found\n";

    #find(\&wanted, @directories);

    This $dir i.e 2.00.A07 is changing on daily basis.Means new
    directories is getting added So how can this be detected that a new
    dir has been added and the $dir will replaced by the new one.
     
    king, Oct 18, 2007
    #1
    1. Advertising

  2. king wrote:
    > #!c:\Perl\bin\perl.exe
    > use Strict;
    > use File::Copy;
    > #use File::find;
    > $dir = "2.00.A07";
    > print "enter the name of the file to be copied:";
    > $file=<>;
    > chomp $file;
    > $filetobecopied = "//Builds/Prerelease/$dir/$file";
    >
    > $newfile = "C:/PERL";
    > copy ($filetobecopied,$newfile) or print "file not found\n";
    >
    > #find(\&wanted, @directories);
    >
    > This $dir i.e 2.00.A07 is changing on daily basis.Means new
    > directories is getting added So how can this be detected that a new
    > dir has been added and the $dir will replaced by the new one.


    Use a globbing operator to get all names that match the directory name
    pattern and then apply whatever algorithm is necessary to find the
    latest one.

    --
    These are my personal views and not those of Fujitsu Siemens Computers!
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://www.fujitsu-siemens.com/imprint.html
     
    Josef Moellers, Oct 18, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnVkeQ==?=

    Sub Dir, Virtual dir, what do I use?

    =?Utf-8?B?UnVkeQ==?=, Jun 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    448
    =?Utf-8?B?UnVkeQ==?=
    Jun 12, 2005
  2. Shawn Modersohn

    replaced vs non replaced

    Shawn Modersohn, Jul 19, 2004, in forum: HTML
    Replies:
    4
    Views:
    1,020
    Shawn Modersohn
    Jul 20, 2004
  3. Saeed
    Replies:
    7
    Views:
    1,123
    Jukka K. Korpela
    Feb 14, 2009
  4. Matthew Denner
    Replies:
    1
    Views:
    218
  5. Skybuck Flying
    Replies:
    6
    Views:
    113
    Grant Edwards
    Apr 2, 2014
Loading...

Share This Page