<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-9702341</atom:id><lastBuildDate>Thu, 04 Aug 2011 20:18:56 +0000</lastBuildDate><category>Python</category><category>PostgreSQL</category><category>MySQL</category><category>SQL</category><category>Windows Automation</category><category>Database</category><category>Jython</category><category>PMP</category><category>Linux</category><category>XML Automation</category><category>WLST</category><category>Weblogic</category><category>Solaris</category><category>Build Automation</category><category>Sed</category><category>Bash</category><category>Perl</category><category>Awk</category><category>Java</category><category>Testing</category><category>Excel</category><title>Systems Automation</title><description>A Blog of Automation and Administration Activities</description><link>http://ullaslinux.blogspot.com/</link><managingEditor>noreply@blogger.com (ullas)</managingEditor><generator>Blogger</generator><openSearch:totalResults>188</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ullas" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ullas" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle>A Blog of Automation and Administration Activities</itunes:subtitle><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-2579513892135459668</guid><pubDate>Sat, 19 Jun 2010 12:30:00 +0000</pubDate><atom:updated>2010-06-19T18:00:57.842+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Some good links to Powershell</title><atom:summary>Good reading
http://www.techotopia.com/index.php/Using_COM_with_Windows_PowerShell

http://www.youdidwhatwithtsql.com/automating-internet-explorer-with-powershell/467
http://www.pvle.be/2009/06/web-ui-automationtest-using-powershell/
http://powershell.com/Mastering-PowerShell.pdf

Active Directory
http://blogs.technet.com/b/benp/archive/2007/04/10/creating-an-ad-shell.aspx
http://</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/some-good-links-to-powershell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-2896870564467471755</guid><pubDate>Sat, 19 Jun 2010 12:27:00 +0000</pubDate><atom:updated>2010-06-19T17:57:56.998+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>RAM Count : Poweshell</title><atom:summary>RAM in MB
$mem = Get-WmiObject -Class Win32_ComputerSystem
# Display memory
"This system has {0} MB Free Memory" -f $($mem.TotalPhysicalMemory/1mb)
Processor cOUNT 
$system = Get-WmiObject -Class Win32_ComputerSystem

Non Working devices
Get-WmiObject Win32_PNPEntity | where {$_.ConfigManagerErrorcode -ne 0}</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/ram-count-poweshell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-5575944924574467519</guid><pubDate>Fri, 18 Jun 2010 16:38:00 +0000</pubDate><atom:updated>2010-06-18T22:08:53.400+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Determine whether a computer is a tower, a mini-tower, a laptop, and so on: Powershell</title><atom:summary>strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    &amp; "{impersonationLevel=impersonate}!\\" _
    &amp; strComputer &amp; "\root\cimv2")
Set colChassis = objWMIService.ExecQuery _
    ("Select * from Win32_SystemEnclosure")
For Each objChassis in colChassis
    For Each objItem in objChassis.ChassisTypes
        Wscript.Echo "Chassis Type: " &amp; objItem
    Next
Next</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/determine-whether-computer-is-tower.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-3944680937527828406</guid><pubDate>Fri, 18 Jun 2010 16:34:00 +0000</pubDate><atom:updated>2010-06-18T22:04:20.607+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Right way to read a file in itration. Powershell</title><atom:summary>Foreach ($name in (Get-Content c:\names.txt))
{
  # do something with $name
}</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/right-way-to-read-file-in-itration.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-2467548974477940363</guid><pubDate>Fri, 18 Jun 2010 16:33:00 +0000</pubDate><atom:updated>2010-06-18T22:03:39.162+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Service Pack in OS. Powershell</title><atom:summary>Get-WmiObject Win32_OperatingSystem | 
Format-List BuildNumber,CSName,ServicePackMajorVersion</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/service-pack-in-os-powershell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-9196824681734928348</guid><pubDate>Fri, 18 Jun 2010 16:32:00 +0000</pubDate><atom:updated>2010-06-18T22:02:28.753+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>UPTIME of server in powershell</title><atom:summary>UPTIME
$myobj.uptime = (Get-Date) - [System.DateTime]::ParseExact($OSInfo.LastBootUpTime.Split(".")[0],'yyyyMMddHHmmss',$null)
        $myobj.uptime = "$($myobj.uptime.Days) days, $($myobj.uptime.Hours) hours," +`
          " $($myobj.uptime.Minutes) minutes, $($myobj.uptime.Seconds) seconds"</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/uptime-of-server-in-powershell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-1844761947241438140</guid><pubDate>Fri, 18 Jun 2010 16:29:00 +0000</pubDate><atom:updated>2010-06-18T21:59:48.266+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Adding data to database with Powershell</title><atom:summary>DaTA base: Add data
$ds = new-object System.Data.DataSet
$ds.Tables.Add("person")
[void]$ds.Tables["person"].Columns.Add("name",[string])
[void]$ds.Tables["person"].Columns.Add("last",[string])
$dr = $ds.Tables["person"].NewRow()
$dr["name"] = "ullas"
$dr["last"] = "t"
$ds.Tables["person"].Rows.Add($dr)
$dr

name last
---- ----
ullas t</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/adding-data-to-database-with-powershell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-3265208880014401737</guid><pubDate>Fri, 18 Jun 2010 16:26:00 +0000</pubDate><atom:updated>2010-06-18T21:56:41.422+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Try Catch template for Powershell</title><atom:summary>Try Catch template
try
{
  try
  {
    # Command that uses -erroraction stop or $erroractionpreference = 'Stop'
  }
  # Here we catch the Exception generated by the ErrorAction "Stop"
  # Only necessary if there is any processing we want to do if the
  # exception is of type ActionPreferenceStopExecution,
  # otherwise this block can be deleted 
  catch [</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/try-catch-template-for-powershell.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-1661894420624851267</guid><pubDate>Fri, 18 Jun 2010 16:24:00 +0000</pubDate><atom:updated>2010-06-18T21:54:45.090+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>WMI Info on Excel</title><atom:summary>$strComputer = “.”

$Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()

$Sheet = $Excel.WorkSheets.Item(1)
$Sheet.Cells.Item(1,1) = “Computer”
$Sheet.Cells.Item(1,2) = “Drive Letter”
$Sheet.Cells.Item(1,3) = “Description”
$Sheet.Cells.Item(1,4) = “FileSystem”
$Sheet.Cells.Item(1,5) = “Size in GB”
$Sheet.Cells.Item(1,6) = “Free Space in GB”

$WorkBook</atom:summary><link>http://ullaslinux.blogspot.com/2010/06/wmi-info-on-excel.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-6275329748560322018</guid><pubDate>Sun, 30 May 2010 16:59:00 +0000</pubDate><atom:updated>2010-05-30T22:29:27.850+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Sample of Powershell usage for displaying in IE</title><atom:summary>$oIE=new-object -com internetexplorer.application
$oIE.navigate2("About:blank")
while ($oIE.busy) {
    sleep -milliseconds 50
}
$oIE.visible=$true
$procList=ps |select-object ProcessName,Handles,NPM,PM,WS,VM,CPU,Id |convertto-html

$oDocBody=$oIE.document.documentelement.lastchild ;

#populate the document.body
$oDocBody.innerhtml=$procList 

$oDocBody.style.font="12pt Arial";
$</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/sample-of-powershell-usage-for.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-8391109241963264330</guid><pubDate>Sun, 30 May 2010 16:03:00 +0000</pubDate><atom:updated>2010-05-30T21:33:54.269+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>A sample of IE automation with power shell</title><atom:summary>
 
# Twitter login name or email
$username_or_email = "xxxxxxxxxxxxxxxx";
# Your twitter password
$password = "xxxxxxxxxxxx";
$url = "http://twitter.com/login";
 
# txt file containing 1 tweet per line
$tweets = Get-Content "$env:USERPROFILE\tweets.txt";
#Interval between tweets
$sleep = 60; 
 
# This is just an attempt to handle the situation where you are already logged into twitter
trap [</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/sample-of-ie-automation-with-power.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-110527502118476774</guid><pubDate>Sun, 30 May 2010 16:01:00 +0000</pubDate><atom:updated>2010-05-31T20:07:20.825+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Template for IE automation with PowerShell</title><atom:summary>&lt;#
    .SYNOPSIS 
      Validates application login userid and password from a given excel sheet
    .EXAMPLE
     validateLogin users.xls
     This command picks userid and password from given excel sheets and validates from given URL
#&gt;
#Set-PSDebug -trace 2 # Debug Information
#Set-PSDebug -step # Debug using stepping


if ($args) 
{
 throw "USAGE: validateLogin users.xls"
}

function </atom:summary><link>http://ullaslinux.blogspot.com/2010/05/template-for-ie-automation-with.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-5804024449464921276</guid><pubDate>Sat, 29 May 2010 05:17:00 +0000</pubDate><atom:updated>2010-05-29T10:47:41.670+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><title>Windows Macros with WSH</title><atom:summary>http://www.icpug.org.uk/national/features/030316fe.htm
Eg.
Dim Wsh
Set Wsh = Wscript.CreateObject("Wscript.Shell")
Wsh.AppActivate "Exploring"
Wsh.SendKeys "{F2}{END}{LEFT}{LEFT}{LEFT}{LEFT}{BS}{BS}{BS}~{DOWN}"

Name it macro.vbs

When I instantiate the WshShell object I need to be able to refer to it in some way. Wsh is a variable for this purpose so, first of all, I explicitly declare it with </atom:summary><link>http://ullaslinux.blogspot.com/2010/05/windows-macros-with-wsh.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-7248388356499435745</guid><pubDate>Fri, 28 May 2010 16:09:00 +0000</pubDate><atom:updated>2010-05-28T22:26:31.958+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Selenium Testing articles</title><atom:summary>1) http://blogs.atlassian.com/developer/2009/06/selenium_testing_with_windows.html

2) http://www.thoughtworks-studios.com/twist-agile-test-automation/1.0/help/how_do_i_use_selenium_to_test_https_sites.html

3) http://yuce.tekol.net/2009/10/web-application-testing-with-selenium.html</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/selenium-testing-articles.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-8715454060763147633</guid><pubDate>Wed, 26 May 2010 15:47:00 +0000</pubDate><atom:updated>2010-05-26T21:17:49.831+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jython</category><category domain="http://www.blogger.com/atom/ns#">WLST</category><category domain="http://www.blogger.com/atom/ns#">Weblogic</category><title>Application Status Checking with WLST</title><atom:summary>def appStatus(server_name):
       try:
           print '---------------------- Application status---------------------'
           mBeans=adminHome.getMBeansByType("ApplicationRuntime")
           for bean in mBeans:
               if server_name != bean.getObjectName().getLocation():
                   continue
               components= bean.lookupComponents()
               for </atom:summary><link>http://ullaslinux.blogspot.com/2010/05/application-status-checking-with-wlst.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-757982319721512576</guid><pubDate>Sat, 22 May 2010 11:22:00 +0000</pubDate><atom:updated>2010-05-22T16:52:46.732+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Database</category><title>Hierarchical Tree Structures in Database Tables</title><atom:summary>http://www.devx.com/tips/Tip/22127</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/hierarchical-tree-structures-in.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-3692326510430586998</guid><pubDate>Sat, 08 May 2010 05:08:00 +0000</pubDate><atom:updated>2010-05-08T10:40:24.615+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Perl: Reading Processes from Unix</title><atom:summary>Here is a way using pipes

open(PS_F, "ps -f|");

while () {
($uid,$pid,$ppid,$restOfLine) = split;
# do whatever I want with the variables here ...
}

close(PS_F);

You can also try with split(/\s+/,$_)</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/perl-reading-processes-from-unix.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-2634675558944267827</guid><pubDate>Sat, 08 May 2010 00:52:00 +0000</pubDate><atom:updated>2010-05-08T06:22:44.554+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Perl</category><category domain="http://www.blogger.com/atom/ns#">Jython</category><category domain="http://www.blogger.com/atom/ns#">Python</category><title>Good Presentation on Patterns</title><atom:summary>http://www.cs.clemson.edu/~malloy/courses/patterns/slides/</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/good-presentation-on-patterns.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-2001022879674985264</guid><pubDate>Fri, 07 May 2010 16:59:00 +0000</pubDate><atom:updated>2010-05-08T06:23:08.411+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Perl and Unix Processes control</title><atom:summary>Here is a script fot this

http://aplawrence.com/Unix/perlforkexec.html

http://docstore.mik.ua/orelly/perl/cookbook/index.htm</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/perl-and-unix-processes-control.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-8875706573609048484</guid><pubDate>Mon, 03 May 2010 16:08:00 +0000</pubDate><atom:updated>2010-05-03T21:38:23.280+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">XML Automation</category><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><category domain="http://www.blogger.com/atom/ns#">Perl</category><category domain="http://www.blogger.com/atom/ns#">Jython</category><category domain="http://www.blogger.com/atom/ns#">Python</category><title>FSM: Mealy State Machine</title><atom:summary>http://web.cs.mun.ca/~paul/cs3724/material/web/notes/node25.html</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/fsm-mealy-state-machine.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-8773973150768925108</guid><pubDate>Mon, 03 May 2010 15:00:00 +0000</pubDate><atom:updated>2010-05-03T20:30:54.160+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">XML Automation</category><category domain="http://www.blogger.com/atom/ns#">Windows Automation</category><category domain="http://www.blogger.com/atom/ns#">Perl</category><category domain="http://www.blogger.com/atom/ns#">Build Automation</category><category domain="http://www.blogger.com/atom/ns#">Linux</category><category domain="http://www.blogger.com/atom/ns#">Jython</category><category domain="http://www.blogger.com/atom/ns#">Sed</category><category domain="http://www.blogger.com/atom/ns#">Python</category><category domain="http://www.blogger.com/atom/ns#">Weblogic</category><title>A huge collection of Algorithms</title><atom:summary>http://www.itl.nist.gov/div897/sqg/dads/</atom:summary><link>http://ullaslinux.blogspot.com/2010/05/huge-collection-of-algorithms.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-3796274582831368162</guid><pubDate>Wed, 28 Apr 2010 10:45:00 +0000</pubDate><atom:updated>2010-04-29T15:49:51.734+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Itrating Hashes in Perl: Many ways</title><atom:summary>1) If you just want the keys and do not plan to ever read any of the values, use keys():

foreach my $key (keys %hash) { ... } 

2) If you just want the values, use values():

foreach my $val (values %hash) { ... } 

3) If you need the keys and the values, use each():

keys %hash; # reset the internal iterator so a prior each() doesn't affect the loop 
while(my($k, $v) = each %hash) { ... } 

4) </atom:summary><link>http://ullaslinux.blogspot.com/2010/04/itrating-hashes-in-perl-many-ways.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-8486333514599100169</guid><pubDate>Wed, 28 Apr 2010 06:21:00 +0000</pubDate><atom:updated>2010-04-28T11:51:46.896+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Command line options with Perl: EG</title><atom:summary>#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
use vars qw/ %opts /;

getopts('he:c:', \%opts );
usage() if $opts{h};
usage() if($opts{e} eq "" or $opts{c} eq "");

sub usage(){
        print "This program should be used as below\n";
        print "usage: $0 [-h] [e petrol] [-c elgi]\n";
        print "  -h        : this (help) message\n";
        print "  -e        : energy name\n";
</atom:summary><link>http://ullaslinux.blogspot.com/2010/04/command-line-options-with-perl-eg.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-3395593977073687058</guid><pubDate>Sun, 25 Apr 2010 05:03:00 +0000</pubDate><atom:updated>2010-04-29T15:50:01.960+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Tips and Tricks in Perl</title><atom:summary>Create an array from a string
@months = split ' ', "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
or
@months = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/

Create a string from an array.
@stuff = ("hello", 0..9, "world"); $string = join '-', @stuff

Generate an array with even numbers from 1 to 100
perl -le '@even = grep {$_ % 2 == 0} 1..100; print "@even"'

The spaceship operator &lt;=&gt;
</atom:summary><link>http://ullaslinux.blogspot.com/2010/04/tips-and-tricks-in-perl.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9702341.post-6059378566915106177</guid><pubDate>Sat, 24 Apr 2010 17:24:00 +0000</pubDate><atom:updated>2010-04-24T22:54:32.436+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Perl</category><title>Random password generator in perl</title><atom:summary>Here is a oneliner for this

perl -le 'print map { ("a".."z")[rand 26] } 1..8'

Here the map function executes ("a".."z")[rand 26] code 8 times (because it iterates over the dummy range 1..8). In each iteration the code chooses a random letter from the alphabet. When map is done iterating, it returns the generated list of characters and print function prints it out by concatenating all the </atom:summary><link>http://ullaslinux.blogspot.com/2010/04/random-password-generator-in-perl.html</link><author>noreply@blogger.com (ullas)</author><thr:total>0</thr:total></item><language>en-us</language><media:rating>nonadult</media:rating></channel></rss>

