Perl questions - more

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl questions - more
# 8  
Old 10-08-2007
Found something that might help - I can get the modified time of a directory..

$filename='D:\Documents and Settings\admin1\Desktop\Perltest';

@attrs = stat($filename);
print "Time of last inode change (ctime) = " . localtime($attrs[9]) . "\n";

How do I tell in perl now that the modification time is within last 2 hours?

ie. I want to alert if modification time is not within last 2 hours or 1 hours... SmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies

2. Shell Programming and Scripting

Perl Debug Stepping Answering Questions

I am new to perl and want to get a little better understanding of debugging code in perl. I have a perl script that has questions to be answered like: he following PERL modules are recommended: Crypt::DES Crypt::PasswdMD5 IO::Pty Net::Write::Layer2 String::CRC32 Attempt to install... (0 Replies)
Discussion started by: metallica1973
0 Replies

3. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

4. Shell Programming and Scripting

Perl newbie questions!

Hi, So I started to learn perl a few days ago, and I have some problems... One of my problems... #!C:\Perl64\bin\perl.exe -w use LWP::Simple; print "Content-Type: Text/Plain\n\n"; sub pagelinks { return @all = get($_) =~ /href\s*=\s*"?(+)/gis; } @a =... (5 Replies)
Discussion started by: byte1918
5 Replies

5. Shell Programming and Scripting

How to answer the Questions in Perl .

I need to write a script to telnet or ssh a device the execute some commands in device then copy the output in a file, I wrote the script but I faced one issue, when you execute some commands the device asked me a Question, for example : device # copy run tftp device # Source filename ? ... (3 Replies)
Discussion started by: DarkSoul
3 Replies

6. Shell Programming and Scripting

perl questions

New to perl and a few questions - usually used to shell scripting but have to write a script to check a few things on windows server and need help.. 1. Check for file missing in sequence.. ie. list of file in directory as follows: file0001.txt file0002.txt file0004.txt file0005.txt... (7 Replies)
Discussion started by: frustrated1
7 Replies

7. Shell Programming and Scripting

chess perl program questions

Hello guys, While going over the book, I ran into this chess program and I have few questions 1) on line 40), why is not $chessboard-> ) ??? 40 unless (defined $chessboard->) { 2) 20 foreach my $i (reverse (0..7)) { #Row 1 #!/usr/bin/perl -w 2 # 3 # 4 5 ... (1 Reply)
Discussion started by: hankooknara
1 Replies

8. Shell Programming and Scripting

Perl: answering automatically to install questions

Hi everybody, I have been looking for an answer to this issue both on google and on the forum, but I couldn't find anything. please help me :eek: As part of an automated (in perl) install of Solaris 9, I would like to be able to answer automaticaly to the question the installer asks.... (2 Replies)
Discussion started by: zaap
2 Replies

9. Shell Programming and Scripting

bash and Perl interaction questions

hi. im working in bash and am trying to create a Perl daemon that controls bashs behavior. this is actually in preparation for a later project ill be working on. basically, im looking for a way to have the Perl daemon tell bash what to do. i already have a small daemon that simply prints... (2 Replies)
Discussion started by: deryk
2 Replies
Login or Register to Ask a Question
Test::EOL(3pm)						User Contributed Perl Documentation					    Test::EOL(3pm)

Test::EOL - Check the correct line endings in your project SYNOPSIS
"Test::EOL" lets you check for the presence of trailing whitespace and/or windows line endings in your perl code. It reports its results in standard "Test::Simple" fashion: use Test::EOL tests => 1; eol_unix_ok( 'lib/', 'Module is ^M free'); and to add checks for trailing whitespace: use Test::EOL tests => 1; eol_unix_ok( 'lib/', 'Module is ^M and trailing whitespace free', { trailing_whitespace => 1 }); Module authors can include the following in a t/eol.t and have "Test::EOL" automatically find and check all perl files in a module distribution: use Test::EOL; all_perl_files_ok(); or use Test::EOL; all_perl_files_ok( @mydirs ); and if authors would like to check for trailing whitespace: use Test::EOL; all_perl_files_ok({ trailing_whitespace => 1 }); or use Test::EOL; all_perl_files_ok({ trailing_whitespace => 1 }, @mydirs ); DESCRIPTION
This module scans your project/distribution for any perl files (scripts, modules, etc) for the presence of windows line endings. FUNCTIONS
all_perl_files_ok all_perl_files_ok( [ \%options ], [ @directories ] ) Applies "eol_unix_ok()" to all perl files found in @directories (and sub directories). If no <@directories> is given, the starting point is one level above the current running script, that should cover all the files of a typical CPAN distribution. A perl file is *.pl or *.pm or *.t or a file starting with "#!...perl" Valid "\%options" currently are: o trailing_whitespace By default Test::EOL only looks for Windows (CR/LF) line-endings. Set this to true to raise errors if any kind of trailing whitespace is present in the file. o all_reasons Normally Test::EOL reports only the first error in every file (given that a text file originated on Windows will fail every single line). Set this a true value to register a test failure for every line with an error. If the test plan is defined: use Test::EOL tests => 3; all_perl_files_ok(); the total number of files tested must be specified. eol_unix_ok eol_unix_ok ( $file [, $text] [, \%options ] ) Run a unix EOL check on $file. For a module, the path (lib/My/ or the name (My::Module) can be both used. $text is the diagnostic label emited after the "ok"/"not ok" TAP output. "\%options" takes the same values as described in "all_perl_files_ok". EXPORT
A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module. ACKNOWLEDGEMENTS
Shamelessly ripped off from Test::NoTabs. SEE ALSO
Test::More, Test::Pod. Test::Distribution, <Test:NoWarnings>, Test::NoTabs, Module::Install::AuthorTests. AUTHORS
o Arthur Axel 'fREW' Schmidt <> o Florian Ragwitz <> o Kent Fredric <> o Peter Rabbitson <> o Tomas Doran <> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Tomas Doran. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-15 Test::EOL(3pm)