Sponsored Content
Top Forums Shell Programming and Scripting How to sort a set of files by date in a directory? Post 302296925 by alexf on Thursday 12th of March 2009 06:49:58 AM
Old 03-12-2009
ok this works fine from a Unix shell. But when I integrate this into my script, I get this compilation error: "Use of implicit split to @_ is deprecated at perl_test2.pm line 19.". My Perl book also says that using @_ in this context is now deprecated. Would you know the workaround here ?
 

10 More Discussions You Might Find Interesting

1. AIX

loop through the directory for files and sort by date and process the first file

hello i have a requirement where i have a direcotry in which i get files in the format STOCKS.20080114.dat STOCKS.20080115.dat STOCKS.20080117.dat STOCKS.20080118.dat i need to loop through the directory and sort by create date descending order and i need to process the first file. ... (1 Reply)
Discussion started by: dsdev_123
1 Replies

2. Linux

sort files by date

Hi All, Sorry to throw this frequent question but I lost my notes on it. How do you list the files by date? I'm on red hat. Thanks in advance, itik (1 Reply)
Discussion started by: itik
1 Replies

3. UNIX for Dummies Questions & Answers

Sort files by date, not showing files from today

Hi all, i'm new here in this forum. I really like the helpful answers in this forum. Here a short question. For a script i have to sort files by date and exclude the files of the actual date. Sorting the files by date and preparing the output for awk is done by this line: ls -l... (3 Replies)
Discussion started by: carlosdivega
3 Replies

4. Shell Programming and Scripting

How to Sort files on date field

:cool: Hi all, I have a pecular issue in sorting these files in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date column (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (4 Replies)
Discussion started by: shivaastrogun
4 Replies

5. Shell Programming and Scripting

Creating date directory and moving files into that directory

I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Discussion started by: ravi030
3 Replies

6. Shell Programming and Scripting

Sort files by date in filename

Hi, I am a newbie to shell programming and I need some help in sorting a list of files in ascending order of date in the filenames. The file format is always : IGL01_AC_D_<YYYYMMDD>_N01_01 For example, in a directory MyDirectory I have the following files: IGL01_AC_D_20110712_N01_01.dat... (11 Replies)
Discussion started by: Yuggy
11 Replies

7. Shell Programming and Scripting

To get the files in a directory for the given date (User entered date)

Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user. For example if a directory contains files as below : > ll total 41 -rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh -rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies

8. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

9. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

10. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies
Lexical::SealRequireHints(3)				User Contributed Perl Documentation			      Lexical::SealRequireHints(3)

NAME
Lexical::SealRequireHints - prevent leakage of lexical hints SYNOPSIS
use Lexical::SealRequireHints; DESCRIPTION
This module works around two historical bugs in Perl's handling of the "%^H" (lexical hints) variable. One bug causes lexical state in one file to leak into another that is "require"d/"use"d from it. This bug, [perl #68590], was present from Perl 5.6 up to Perl 5.10, fixed in Perl 5.11.0. The second bug causes lexical state (normally a blank "%^H" once the first bug is fixed) to leak outwards from "utf8.pm", if it is automatically loaded during Unicode regular expression matching, into whatever source is compiling at the time of the regexp match. This bug, [perl #73174], was present from Perl 5.8.7 up to Perl 5.11.5, fixed in Perl 5.12.0. Both of these bugs seriously damage the usability of any module relying on "%^H" for lexical scoping, on the affected Perl versions. It is in practice essential to work around these bugs when using such modules. On versions of Perl that require such a workaround, this module globally changes the behaviour of "require", including "use" and the implicit "require" performed in Unicode regular expression matching, so that it no longer exhibits these bugs. The workaround supplied by this module takes effect the first time its "import" method is called. Typically this will be done by means of a "use" statement. This should be done as early as possible, because it only affects "require"/"use" statements that are compiled after the workaround goes into effect. For "use" statements, and "require" statements that are executed immediately and only once, it suffices to invoke the workaround when loading the first module that will set up vulnerable lexical state. Delayed-action "require" statements, however, are more troublesome, and can require the workaround to be loaded much earlier. Ultimately, an affected Perl program may need to load the workaround as very nearly its first action. Invoking this module multiple times, from multiple modules, is not a problem: the workaround is only applied once, and applies to everything subsequently compiled. This module is implemented in XS, with a pure Perl backup version for systems that can't handle XS modules. The XS version has a better chance of playing nicely with other modules that modify "require" handling. The pure Perl version can't work at all on some Perl versions; users of those versions must use the XS. PERL VERION DIFFERENCES
The history of the "%^H" bugs is complex. Here is a chronological statement of the relevant changes. Perl 5.6.0 "%^H" introduced. It exists only as a hash at compile time. It is not localised by "require", so lexical hints leak into every module loaded, which is bug [perl #68590]. The "CORE::GLOBAL" mechanism doesn't work cleanly for "require", because overriding "require" loses the necessary special parsing of bareword arguments to it. As a result, pure Perl code can't properly globally affect the behaviour of "require". Pure Perl code can localise "%^H" itself for any particular "require" invocation, but a global fix is only possible through XS. Perl 5.7.2 The "CORE::GLOBAL" mechanism now works cleanly for "require", so pure Perl code can globally affect the behaviour of "require" to achieve a global fix for the bug. Perl 5.8.7 When "utf8.pm" is automatically loaded during Unicode regular expression matching, "%^H" now leaks outward from it into whatever source is compiling at the time of the regexp match, which is bug [perl #73174]. It often goes unnoticed, because [perl #68590] makes "%^H" leak into "utf8.pm" which then doesn't modify it, so what leaks out tends to be identical to what leaked in. If [perl #68590] is worked around, however, "%^H" tends to be (correctly) blank inside "utf8.pm", and this bug therefore blanks it for the outer module. Perl 5.9.4 "%^H" now exists in two forms. In addition to the relatively ordinary hash that is modified during compilation, the value that it had at each point in compilation is recorded in the compiled op tree, for later examination at runtime. It is in a special representation- sharing format, and writes to "%^H" are meant to be performed on both forms. "require" does not localise the runtime form of "%^H" (and still doesn't localise the compile-time form). A couple of special "%^H" entries are erroneously written only to the runtime form. Pure Perl code, although it can localise the compile-time "%^H" by normal means, can't adequately localise the runtime "%^H", except by using a string eval stack frame. This makes a satisfactory global fix for the leakage bug impossible in pure Perl. Perl 5.10.1 "require" now properly localises the runtime form of "%^H", but still not the compile-time form. A global fix is once again possible in pure Perl, because the fix only needs to localise the compile-time form. Perl 5.11.0 "require" now properly localises both forms of "%^H", fixing [perl #68590]. This makes [perl #73174] apparent without any workaround for [perl #68590]. The special "%^H" entries are now correctly written to both forms of the hash. Perl 5.12.0 The automatic loading of "utf8.pm" during Unicode regular expression matching now properly restores "%^H", fixing [perl #73174]. BUGS
The operation of this module depends on influencing the compilation of "require". As a result, it cannot prevent lexical state leakage through a "require" statement that was compiled before this module was invoked. Where problems occur, this module must be invoked earlier. SEE ALSO
perlpragma AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2009, 2010, 2011, 2012 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2017-10-06 Lexical::SealRequireHints(3)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy