Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.
# Usage : First need to manually create the temp.log and temp2.log files # Purpose : Shows how to open files with 2 or with 3 arguments. # Returns : no change to temp.log and temp2.log because they are input only # the perm.log and perm2.log files are created and overwritten each time # the program is run # Parameters : # comments: Best Practices recommends the 3 argument method for clarity, # but other books say to use the 2 argument for backwards compatiblity # See Perl Best Practices pg 55 for info on the Readonly module # Summarized here: better alternative to using keyword constant use Readonly; #I had to use PPM to install this module use Carp; #included with Perl, need this for the croak function #example had >temp.log but this is not a valid name for windows Readonly my $ACTIVE_LOG1 => 'temp.log'; Readonly my $STATIC_LOG1 => 'perm.log'; use constant ACTIVE_LOG2 => 'temp2.log'; use constant STATIC_LOG2 => 'perm2.log'; #open modes # < input only # > output only # >> open in append mode # +< r/w update access # +> w/r update access # +>> read append # Intention is to .... open temp.log for input only # open perm.log for output/overwriting only open my $active1, "<$ACTIVE_LOG1" or croak "Can't open '$ACTIVE_LOG1': $!"; open my $static1, ">$STATIC_LOG1" or croak "Can't open '$STATIC_LOG1': $!"; # Here is the 3 argument open open my $active2, '<', "ACTIVE_LOG2" or croak "Can't open 'ACTIVE_LOG2'"; open my $static2, '>', "STATIC_LOG2" or croak "Can't open 'STATIC_LOG2'"; print $active1 "active1 line 1a"; print $static1 "static1 line 1b"; print $active2 "active2 line 1a"; print $static2 "static2 line 1b";
|How to tell if a file is being written with Perl running on a Windows 2003 Server||12||28|
|binary to char / hexadecimal||5||98|
|Any syntax error for this clone.plscript||6||124|
|quoting a comma separated list||20||63|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!