Home > Cannot Call > Cannot Call Method Mtime On An Undefined Value

Cannot Call Method Mtime On An Undefined Value

I am using MAC OS v10.8.5. None. InReplyToAlso I assume adding date and time to a file is different on *nix than Windows.No, altering the filename is done exactly the same in both systems. Search this Thread 05-23-2007, 08:00 AM #1 kshkid Member Registered: Dec 2005 Distribution: RHEL3, FC3 Posts: 383 Rep: perl - stat is not working Hi All, Am trying to weblink

Find all posts by Corona688 #4 08-23-2011 pludi Cat herder Join Date: Dec 2008 Last Activity: 28 March 2014, 8:35 AM EDT Location: Vienna, Austria, Earth Posts: Ich hab um einen CTIME Prototype mismatch zu verhindern das Code: use Time::localtime qw/localtime/; (wie zu sehen) mit "qw/localtime/" versehen... Trouble with stat 6. XPath / XQuery XSLT HTTP-Server Tomcat JBOSS Glassfish Apache Nginx Andere Web, DTP, 3D, Audio, Video (deprecated) Web Development Active Server Pages (ASP) Content Management Diverses eMail-Probleme FTP HTML JavaScript Webserver

None. This works on both Windows and *nix systems. alexhon UNIX for Dummies Questions & Answers 1 05-10-2005 03:36 AM ISDN on Linux..will it work? If you need to reset your password, click here.

Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. I am checking for a null value slipping in the array but that doesn't seem to be it. Join our community today! Code: #!/usr/bin/perl -w use File::Find; use File::stat; for ($count = 1; $count <= 23; $count++){ $#file = -1; # Zero-out array $dir = "/home/bed_mfg1/event_logs"; find(\&Wanted, $dir); @file=reverse(sort(@file)); open (FILE, "> /tmp/event_logs_listing.tmp")

Here is the relevent code: $now_time = time(); # Read the files in the dir to an array $i=0; find(sub{$dir_list[$i] = $File::Find::name; $i++;}, $opt_i); $j=0; $stats = stat($dir_list[$i]); if($dir_list[$i] Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. In order to stat the file, you wouldhave to get it first.Fortunately, Net::FTP includes the mdtm() method. `perldoc Net::FTP`for the details.HTH,-- jay--------------------------------------------------This email and attachment(s): [ ] blogable; [ x ] http://www.perlmonks.org/bare/?node_id=446625 The file will be uploaded to a ftp server, so I need to preserve the file-name.

dsgdevil Linux - Software 19 07-15-2003 07:45 PM my perl is not working, please help me rhuser Linux - Software 7 03-14-2003 02:12 PM cant get perl working dsgdevil Linux - Therefore, the 'default' path without specifying the dir is whatever dir your prog resides in. Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us. Vervielfältigung nur mit Genehmigung des Verlags.

If you pass it a string, it assumes that string is a path name. http://computer-programming-forum.com/53-perl/eb1011acf6ed48a2.htm The specific errir that i get is "Can't call method "mtime" on an undefined value at ./make_event_log_index.pl line 25." Any help would be appreciated .................................................................................................... Denn sonst könnte ich auch einfach die Werte aus dem Array auslesen... 09.12.2010,10:05 #6 Christian Marquardt Profil Beiträge anzeigen Private Nachricht Forenheld Registriert seit 26.02.2003 Beiträge 16.021 bereits von nem anderen Ergebnis 1 bis 9 von 9 Thema: PERL: Can't call method MTIME Themen-Optionen Druckbare Version zeigen Thema weiterempfehlen… Anzeige Linear-Darstellung Zur Hybrid-Darstellung wechseln Zur Baum-Darstellung wechseln 08.12.2010,17:41 #1 rioc Profil Beiträge

Ich leiste keinen Privatsupport per Mail oder PN! http://electrictricycle.net/cannot-call/cannot-call-method-of-undefined-requirejs.html Also: There can be only one! [cue Thunder sound] Remove advertisements Sponsored Links pludi View Public Profile Find all posts by pludi #5 08-23-2011 hfreyer Registered User Join by borisz (Canon) on Apr 11, 2005 at 10:49EDT Your code should work fine, if you add a ; after use Employee and a my before $name = $person->name;. Whether I use stat command or -M operator, I am getting error messages like "Use of uninitialized value…" or "Can't call method "mtime" on an undefined value" depending on which method

On 1941 Dec 7, could Japan have destroyed the Panama Canal instead of Pearl Harbor in a surprise attack? Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Forum Operations by The UNIX and Linux Forums Front page | perl.beginners | Postings from February 2003 Re: lstat($_)->mtime fails Thread Previous | Thread Next From: Rob Dixon Date: February 5, check over here File::stat->mode? 9.

The closest I ever got was using this: Code$file = /path/to/file; $datetime_string = ctime(stat($file)->mtime); But that doesn't add the date , time to the file-name. The problem is the missing semi-colon after use Employee. Your list of files to stat is on a remote server thatmust be accessed by a special protocol (in this case FTP), but youhaven't given stat() any information about how to

Hi Arild.

Sean -- Sean Lavelle Concentus Technology Corporation 5115 Parkcenter Ave, Suite 150 Dublin, Ohio 43017 Phone (614) 799-4317 Wed, 18 Jun 1902 08:00:00 GMT newspos..#2 / 3 Gruß Falk Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware. danke Schreibe jedoch vielleicht nochmals hier rein... All Rights Reserved.

Every time I compile it says: Can't call method "name" on an undefined value at ./test.pl line 9. ### test.pl ### use Employee my $person = Employee->new(); $person->name("bob"); $name = $person->name; Smileys sind an. [IMG] Code ist an. [VIDEO] Code ist an. same uninitialized value error message $latestfile = $moviedir[1]; print "file is: $latestfile\n"; open (FH,$latestfile); #$diff_mins = (stat($latestfile))[9]; #didn't work, same uninitialized value error message my $diff_mins = (stat(FH)->mtime); # Can't call this content You have to stat() the actual files, not the refs to them in the dir inode file.

You've just given it a string which it assumes, rightly, should be a file on the local file system. I'm pretty new to perl, so forgive my newbie questions. share|improve this answer edited Mar 22 '14 at 1:32 Miller 31.1k42446 answered Mar 21 '14 at 17:10 jimtut 1,68011122 Thanks Jim. Check perlport and either the rename(2) manpage or equivalent system documentation for details.

Is there a method to skip sub-directories and consider only files within a directory? Any suggestions?