Skip to content

Instantly share code, notes, and snippets.

@cwg999
Last active September 8, 2017 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwg999/969794e93c16f939cbdbe7fb7340d459 to your computer and use it in GitHub Desktop.
Save cwg999/969794e93c16f939cbdbe7fb7340d459 to your computer and use it in GitHub Desktop.
PowerShell vs. Perl

ls <path> | ?{$_.Name -match "^$"}

is shorthand for

Get-Child <path> | Where-Child {$_.Name -match "^$"}

in powershell.

Versus perl -le"foreach (<path>){if(m/^$/){print $_ } }"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment