14 Aug, 2010

Perl how to remove an element from an array

Articles related to perl how to remove an element from an array

PERL: How to remove an element from hash or array?

http://digitalpbk.com/perl/how-remove-element-hash-or-array PERL: How to remove an element from hash or array? In order to remove an element from the array or hash, we have to use the delete keyword on perl. Using the delete keyword on the key of the hash or array (numeric keyed hash), we can delete elements of a hash or array. Example for deleting an element from a hash The following code deletes the key 'a' from the hash %hash. #!/usr/bin/perl $, = "\n"; # Fields separator my %hash = ( 'a' => 'aaa', 'b' ...
Published 2 years, 1 month ago

Gumblar Virus Javascript removal using PERL

http://digitalpbk.com/virus/gumblar-web-virus-manual-removal-free-tool Gumblar Virus Javascript removal using PERL Gumblar virus infects all .html and .php files and injects a piece of javascript in the source code. The code is usually found just below the <body> tag. The Javascript code Gumblar injects varies widely and usually attaches a script or inline frame inside your page to execute itself on page load. Read on to get rid of this virus. Gumblar Source Code Samples when delimited by new lines Sample 1 var D; if(D!='' ...
Published 2 years, 1 month ago

JSON- Javascript Object Notation

http://digitalpbk.blogspot.com/2007/06/json-javascript-object-notation.html response, we have to use the following notation,Suppose we are returning an XML response from a server using Ajax. The common method to extract the useful information is :var xml = xmlHttp.responseXML;var list= xml.getElementsByTagName("TAG");for(i=0;i {// loop through and extract the values}This can be replaced with the new JSON object notation byvar strobj = xmlHttp.responseText;var obj = eval("("+strobj+")");obj.an_array[0];obj.a_multi_array[0][0];// ....The Notation ...
Published 4 years, 11 months ago

Perl script to remove a directory and contents recursively

http://digitalpbk.com/perl/perl-script-remove-directory-and-contents-recursively Perl script to remove a directory and contents recursively This is the script for sandeep when he asked me how to delete a directory in perl. rmdir function only removes empty directories. So we need to remove the contents of the directory before removing the directory. So if the directory contains more directories / folders we would have to recursively delete all the directories under the directory. Well so here is the code just to do that. #!/usr/bin/perl deldir("test"); ...
Published 2 years, 5 months ago

PERL Referencing and Dereferencing

http://digitalpbk.blogspot.com/2007/10/perl-referencing-and-dereferencing.html PERL Referencing and Dereferencing IntroPERL - Practical Extraction and Report Language.Referencing a variable means creating a pointer to the variable. Referencing in C is done by the & operator, but in PERL referencing is done by the \(backslash) operator.Check out the following examples to understand better:my $scalar = "http://digitalpbk.blogspot.com";my $scalar_ptr = \$scalar; //Scalar referencemy $array= (1,2,4,3,5);my $array_ptr = \@array; //Array reference//ormy $array ...
Published 4 years, 7 months ago

FTPCHK3 : Virus that adds malicious scripts to your website.

http://digitalpbk.blogspot.com/2009/10/ftpchk3-virus-php-pl-hacked-website.html 0YXJ0KCRzWyRpXVswXSk7ZWNobyAkc1skaV1bMV07fX19JGIwc3JsPSgoJGE9QHNldF9lcnJvcl9oYW5kbGVyKCdiMHNyMicpKSE9J2Iwc3IyJyk/JGE6MDtldmFsKGJhc2U2NF9kZWNvZGUoJF9QT1NUWydlJ10pKTs=')); ?>The code adds scripts to your code likeand executes codes coming via POST requests.Removal Backup your web directory, just in case something gets messed up.The following scripts scans files and removes most of the infection. I have written it to remove infected files from college website and it worked fine. Paste the following code in your web directory and execute. It renames infected files with file.infected and removes code from the file and updates your file to remove the code.#!/usr/bin/perl ...
Published 2 years, 7 months ago

Perl ImageMagick convert Images from one format to another

http://digitalpbk.blogspot.com/2009/07/perl-imagemagick-convert-jpeg-png-bmp.html Perl ImageMagick convert Images from one format to another IntroductionA Picture speaks louder than a thousand words. Most of the programming problems I usually worked with and involved in where dealing with just TEXT. So now I wanted to programatically work with images. I needed to warp, rotate, scale, stretch, convert from jpeg to png, png to jpeg, jpeg to bmp, bmp to jpeg etc. So I decided to search on how to do such a thing easily. Well the first obvious answer is to do handle all ...
Published 2 years, 10 months ago

Firefox Browser within Browser

http://digitalpbk.blogspot.com/2007/01/firefox-browser-within-browser.html Firefox Browser within Browser Browser within Browser ? This effect is only for Mozilla Firefox. Pastechrome://browser/content/browser.xul into your address bar and press Enter.What? How?All interfaces on firefox are made on XUL's. The browser window you see is browser.xul, accessing that simply displays the browser window again as the content. Quoted from mozilla.org XUL is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees etc. User actions are bound ...
Published 5 years, 4 months ago

Perl - cPanel V3 and the @INC

http://digitalpbk.blogspot.com/2007/09/cpanel-v3-perl-include-inc.html Perl - cPanel V3 and the @INC Modifying @INC in a SCRIPTuse Module;is executed during compile time so if you modify the @INC array at run time it will not be reflected back in the compile time. So if you have to include any more include locations in the @INC inside a script, give it inside the BEGIN { }block.BEGIN{ push @INC,"location";}The BEGIN blocks are executed during compile time. So @INC is updated at compile time and the use module are correctly searched for in the updated ...
Published 4 years, 8 months ago

My First useful PERL program

http://digitalpbk.blogspot.com/2007/05/my-first-useful-perl-program.html My First useful PERL program #!/usr/bin/perl -w$username = $ARGV[0];$username = "s28arunpbk" if(!$username); ## Get the username from the first command line argument# If null assign my user id.#use LWP;use LWP::UserAgent;## Initialize objects#$ua = LWP::UserAgent->new;$ua->agent("Checkmap/1.0");my $req=HTTP::Request->new(GET => "http://sitemeter.com/?a=stats&s;=$username&r;=0");my $res = $ua->request($req);## Send a request and grab ...
Published 5 years ago

Related help topics for perl how to remove an element from an array More keywords like perl how to remove an element from an array
More pages for perl how to remove an element from an array


Email Newsletter
Email:
Popular Posts
Recent Posts
Tags
Random photo
Rainbow appearence near Havelock Island Rainbow appearence near Havelock Island in Havelock Island Andaman
On Facebook
Recent Comments


digitalpbk