06-22-2011
Advanced perl help in windows
Hi guys,
Im trying to write a perl code to do the following task.
prerequisites:-
1) some media files(say boys.mp3 or gaga.mpeg or snoop.flv) is located in C:\videos\
2) The perl code is also located in same location C:\videos\
when I execute this perl code, it should ask for a number say 100 or 200 or even 5000 for variable n and a filename that is located in C:\videos\
and then it should duplicate that file n number of times and rename all the files with some random filenames.
Say if snoop.flv is given and n=5 then it should duplicate 5 times and rename it
eg:-
aksjg.flv
ojregnos.flv
aeofasjdavsf.flv
wajgtoih.flv
lkfj.flv
please provide your input guys
thanks
8 More Discussions You Might Find Interesting
1. Windows & DOS: Issues & Discussions
Does anyone know of a Good perl compiler for windows ? i have searched google.com and a few other search engines but they havent turned up anything good. Any and all help would be appreciated (3 Replies)
Discussion started by: JeZzTeR
3 Replies
2. Shell Programming and Scripting
Hi all this is the code which i tried executing in windows environment to send a test mail.
# Perl script to send mail on deliver complete.
package SendMail;
use Config;
use Mail::Send;
@ISA = qw(Mail::Send);
sub open {
my $me = shift;
my $how; # How to send mail
my $notused;
my... (13 Replies)
Discussion started by: victorvvk
13 Replies
3. Shell Programming and Scripting
Hi
Even though this is unix forum, iam posting this thread as iam not sure of which forum should i post this too.
I understand perl can be used in unix environment and i have used the same for automation of my processes.
Eg:
Open a file
search the text string
replace the text string
close... (9 Replies)
Discussion started by: kenkanya
9 Replies
4. Shell Programming and Scripting
Hi All,
I have to write a PERL script in which I have to FTP results from UNIX to Windows Desktop.
How can I do this using PERL?
Thanks (1 Reply)
Discussion started by: kunal1514
1 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
Need help configuring Active Perl on Windows Vista.
I am trying to install Active Perl on Windows Vista.
The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006
After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies
6. UNIX for Dummies Questions & Answers
I got this perl code for solaris from tyler_durden
Please help me to run the same on windows as i am unable to install date::calc program on unix
perl -F, -M"Date::Calc qw(Add_Delta_DHMS)" -lane '
if ($ARGV eq "file2") {
$os{$F} = $F.join($F, unpack("A2A2",$F));
} else {
... (1 Reply)
Discussion started by: ssantoshss
1 Replies
7. Windows & DOS: Issues & Discussions
I dual boot between Windows XP and Linux Mint. I am trying to get the Windows Advanced Options Menu to show up. Normally you would press f8 to make this happen when your computer is booting. With a dual boot it makes it way more complicated. If you press f8 when your computer first starts it does... (3 Replies)
Discussion started by: cokedude
3 Replies
8. Shell Programming and Scripting
I am writing a perl code(windows) to traceroute IP address and to print the output.
I had executed the below code which was taken from cpan modules
#!C:/perl/bin/perl.exe
use Net::Traceroute;
$tr = Net::Traceroute->new(host=> "google.com");
if($tr->found) {
my $hops = $tr->hops;
if($hops... (4 Replies)
Discussion started by: giridhar276
4 Replies
LEARN ABOUT OSX
file::find::rule::procedural
File::Find::Rule::Procedural(3) User Contributed Perl Documentation File::Find::Rule::Procedural(3)
NAME
File::Find::Rule::Procedural - File::Find::Rule's procedural interface
SYNOPSIS
use File::Find::Rule;
# find all .pm files, procedurally
my @files = find(file => name => '*.pm', in => @INC);
DESCRIPTION
In addition to the regular object-oriented interface, File::Find::Rule provides two subroutines for you to use.
"find( @clauses )"
"rule( @clauses )"
"find" and "rule" can be used to invoke any methods available to the OO version. "rule" is a synonym for "find"
Passing more than one value to a clause is done with an anonymous array:
my $finder = find( name => [ '*.mp3', '*.ogg' ] );
"find" and "rule" both return a File::Find::Rule instance, unless one of the arguments is "in", in which case it returns a list of things
that match the rule.
my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
Please note that "in" will be the last clause evaluated, and so this code will search for mp3s regardless of size.
my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
^
|
Clause processing stopped here ------/
It is also possible to invert a single rule by prefixing it with "!" like so:
# large files that aren't videos
my @files = find( file =>
'!name' => [ '*.avi', '*.mov' ],
size => '>20M',
in => $ENV{HOME} );
AUTHOR
Richard Clamp <richardc@unixbeard.net>
COPYRIGHT
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
File::Find::Rule
perl v5.16.2 2011-09-19 File::Find::Rule::Procedural(3)