cvs commit: perlfaq/bin splitfaq

[email protected]
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
cvsuser     02/07/10 22:48:17

  Modified:    bin      splitfaq
  Log:
  * made the destination directory a command line argument because i
  couldn't decide what it should be.  i should rework this so
  that it doesn't look stupid. :)
  
  Revision  Changes    Path
  1.2       +10 -1     perlfaq/bin/splitfaq
  
  Index: splitfaq
  ===================================================================
  RCS file: /cvs/public/perlfaq/bin/splitfaq,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- splitfaq	6 Jul 2002 03:33:57 -0000	1.1
  +++ splitfaq	11 Jul 2002 05:48:16 -0000	1.2
  @@ -3,7 +3,16 @@
   use strict;
   use warnings;
   
  -my $dir = "$ENV{HOME}/faqs";
  +unless( defined $ARGV[0] )
  +	{
  +	die "Please specify the destination directory\n";
  +	}
  +
  +my $dir = shift @ARGV;
  +unless( -d $dir )
  +	{
  +	mkdir $dir, 0755 or die "Could not create $dir: $!";
  +	}
   
   my $skip = 1;
   my $faq;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.